aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/model/GpgKeyTableProxyModel.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-10-26 13:43:14 +0000
committersaturneric <[email protected]>2024-10-26 13:43:14 +0000
commit24c28eb752aa611dd1670f3fa7ab6b358b052f1b (patch)
tree6a4f9af003fa4a86b7d7e29a965e37a231951092 /src/core/model/GpgKeyTableProxyModel.cpp
parentfix: thread concurrent crash issue (diff)
downloadGpgFrontend-24c28eb752aa611dd1670f3fa7ab6b358b052f1b.tar.gz
GpgFrontend-24c28eb752aa611dd1670f3fa7ab6b358b052f1b.zip
fix: test basic operations of multi key db and solve issues
Diffstat (limited to 'src/core/model/GpgKeyTableProxyModel.cpp')
-rw-r--r--src/core/model/GpgKeyTableProxyModel.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/model/GpgKeyTableProxyModel.cpp b/src/core/model/GpgKeyTableProxyModel.cpp
index f1e715cd..49ce211f 100644
--- a/src/core/model/GpgKeyTableProxyModel.cpp
+++ b/src/core/model/GpgKeyTableProxyModel.cpp
@@ -58,7 +58,12 @@ auto GpgKeyTableProxyModel::filterAcceptsRow(
int source_row, const QModelIndex &sourceParent) const -> bool {
auto index = sourceModel()->index(source_row, 6, sourceParent);
auto key_id = sourceModel()->data(index).toString();
- auto key = GpgKeyGetter::GetInstance().GetKey(key_id);
+
+ auto key =
+ GpgKeyGetter::GetInstance(model_->GetGpgContextChannel()).GetKey(key_id);
+ LOG_D() << "get key: " << key_id
+ << "from channel: " << model_->GetGpgContextChannel();
+ assert(key.IsGood());
if (!(display_mode_ & GpgKeyTableDisplayMode::kPRIVATE_KEY) &&
key.IsPrivateKey()) {
@@ -177,4 +182,9 @@ void GpgKeyTableProxyModel::slot_update_column_type(
#endif
}
+void GpgKeyTableProxyModel::ResetGpgKeyTableModel(
+ QSharedPointer<GpgKeyTableModel> model) {
+ model_ = std::move(model);
+ setSourceModel(model_.get());
+}
} // namespace GpgFrontend \ No newline at end of file