diff options
author | saturneric <[email protected]> | 2024-10-26 13:43:14 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-10-26 13:43:14 +0000 |
commit | 24c28eb752aa611dd1670f3fa7ab6b358b052f1b (patch) | |
tree | 6a4f9af003fa4a86b7d7e29a965e37a231951092 /src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp | |
parent | fix: thread concurrent crash issue (diff) | |
download | GpgFrontend-24c28eb752aa611dd1670f3fa7ab6b358b052f1b.tar.gz GpgFrontend-24c28eb752aa611dd1670f3fa7ab6b358b052f1b.zip |
fix: test basic operations of multi key db and solve issues
Diffstat (limited to 'src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp')
-rw-r--r-- | src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp b/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp index 5e9558d5..7bb0167d 100644 --- a/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp +++ b/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp @@ -35,17 +35,20 @@ namespace GpgFrontend::UI { -KeyUIDSignDialog::KeyUIDSignDialog(const GpgKey& key, UIDArgsListPtr uid, - QWidget* parent) +KeyUIDSignDialog::KeyUIDSignDialog(int channel, const GpgKey& key, + UIDArgsListPtr uid, QWidget* parent) : GeneralDialog(typeid(KeyUIDSignDialog).name(), parent), + current_gpg_context_channel_(channel), m_uids_(std::move(uid)), m_key_(key) { + assert(m_key_.IsGood()); + const auto key_id = m_key_.GetId(); - m_key_list_ = - new KeyList(KeyMenuAbility::kCOLUMN_FILTER | KeyMenuAbility::kSEARCH_BAR, - GpgKeyTableColumn::kNAME | GpgKeyTableColumn::kEMAIL_ADDRESS | - GpgKeyTableColumn::kKEY_ID, - this); + m_key_list_ = new KeyList( + channel, KeyMenuAbility::kCOLUMN_FILTER | KeyMenuAbility::kSEARCH_BAR, + GpgKeyTableColumn::kNAME | GpgKeyTableColumn::kEMAIL_ADDRESS | + GpgKeyTableColumn::kKEY_ID, + this); m_key_list_->AddListGroupTab( tr("Signers"), "signers", GpgKeyTableDisplayMode::kPRIVATE_KEY, [key_id](const GpgKey& key) -> bool { @@ -103,9 +106,14 @@ KeyUIDSignDialog::KeyUIDSignDialog(const GpgKey& key, UIDArgsListPtr uid, void KeyUIDSignDialog::slot_sign_key(bool clicked) { // Set Signers auto key_ids = m_key_list_->GetChecked(); - auto keys = GpgKeyGetter::GetInstance().GetKeys(key_ids); + auto keys = + GpgKeyGetter::GetInstance(current_gpg_context_channel_).GetKeys(key_ids); auto expires = std::make_unique<QDateTime>(expires_edit_->dateTime()); + for (const auto& key : *keys) { + assert(key.IsGood()); + } + for (const auto& uid : *m_uids_) { // Sign For mKey if (!GpgKeyManager::GetInstance().SignKey(m_key_, *keys, uid, expires)) { |