From aa90cf1eb97e39f99e622753bb0624ed8dff7775 Mon Sep 17 00:00:00 2001 From: saturneric Date: Sat, 26 Oct 2024 16:20:13 +0200 Subject: fix: should select channel before any gpg operation --- src/ui/dialog/keypair_details/KeyPairUIDTab.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/ui/dialog/keypair_details/KeyPairUIDTab.cpp') diff --git a/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp b/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp index 4846f58a..87f5e10e 100644 --- a/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp +++ b/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp @@ -389,7 +389,8 @@ void KeyPairUIDTab::slot_del_uid() { if (ret == QMessageBox::Yes) { for (const auto& uid : *selected_uids) { - if (!GpgUIDOperator::GetInstance().RevUID(m_key_, uid)) { + if (!GpgUIDOperator::GetInstance(current_gpg_context_channel_) + .RevUID(m_key_, uid)) { QMessageBox::critical( nullptr, tr("Operation Failed"), tr("An error occurred during the delete %1 operation.").arg(uid)); @@ -423,8 +424,8 @@ void KeyPairUIDTab::slot_set_primary_uid() { QMessageBox::No | QMessageBox::Yes); if (ret == QMessageBox::Yes) { - if (!GpgUIDOperator::GetInstance().SetPrimaryUID(m_key_, - selected_uids->front())) { + if (!GpgUIDOperator::GetInstance(current_gpg_context_channel_) + .SetPrimaryUID(m_key_, selected_uids->front())) { QMessageBox::critical(nullptr, tr("Operation Failed"), tr("An error occurred during the operation.")); } else { @@ -520,7 +521,8 @@ void KeyPairUIDTab::slot_del_uid_single() { QMessageBox::No | QMessageBox::Yes); if (ret == QMessageBox::Yes) { - if (!GpgUIDOperator::GetInstance().RevUID(m_key_, selected_uids->front())) { + if (!GpgUIDOperator::GetInstance(current_gpg_context_channel_) + .RevUID(m_key_, selected_uids->front())) { QMessageBox::critical(nullptr, tr("Operation Failed"), tr("An error occurred during the operation.")); } else { @@ -572,7 +574,8 @@ void KeyPairUIDTab::slot_del_sign() { QMessageBox::No | QMessageBox::Yes); if (ret == QMessageBox::Yes) { - if (!GpgKeyManager::GetInstance().RevSign(m_key_, selected_signs)) { + if (!GpgKeyManager::GetInstance(current_gpg_context_channel_) + .RevSign(m_key_, selected_signs)) { QMessageBox::critical(nullptr, tr("Operation Failed"), tr("An error occurred during the operation.")); } -- cgit v1.2.3