From e276f9e86b161362d6f379ab790476936a0e6208 Mon Sep 17 00:00:00 2001 From: saturneric Date: Thu, 17 Apr 2025 17:28:04 +0200 Subject: feat: generate cark keys --- src/ui/widgets/KeyTreeView.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/ui/widgets/KeyTreeView.cpp') diff --git a/src/ui/widgets/KeyTreeView.cpp b/src/ui/widgets/KeyTreeView.cpp index a6fb23bf..2d4d8d8c 100644 --- a/src/ui/widgets/KeyTreeView.cpp +++ b/src/ui/widgets/KeyTreeView.cpp @@ -116,7 +116,7 @@ void KeyTreeView::init() { }); connect(UISignalStation::GetInstance(), - &UISignalStation::SignalKeyDatabaseRefresh, this, [=] { + &UISignalStation::SignalKeyDatabaseRefreshDone, this, [=] { model_ = QSharedPointer::create( channel_, GpgAbstractKeyGetter::GetInstance(channel_).Fetch(), [](auto) { return false; }, this); @@ -143,11 +143,14 @@ void KeyTreeView::SetChannel(int channel) { } auto KeyTreeView::GetKeyByIndex(QModelIndex index) -> GpgAbstractKeyPtr { - auto* i = index.isValid() - ? static_cast(index.internalPointer()) + auto s_index = proxy_model_.mapToSource(index); + auto* i = s_index.isValid() + ? static_cast(s_index.internalPointer()) : nullptr; assert(i != nullptr); return i->SharedKey(); } + +void KeyTreeView::Refresh() { SetChannel(channel_); } } // namespace GpgFrontend::UI -- cgit v1.2.3