diff options
author | saturneric <[email protected]> | 2024-11-26 16:23:46 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-11-26 16:23:46 +0000 |
commit | f19beee8e28621bb045e45d71c963fbba1307f4b (patch) | |
tree | 20a8f52df99724f10bb20aa5273fe506f08e614e /src/ui/main_window/MainWindowFileSlotFunction.cpp | |
parent | fix: change "Advance" to "Advanced" (diff) | |
download | GpgFrontend-f19beee8e28621bb045e45d71c963fbba1307f4b.tar.gz GpgFrontend-f19beee8e28621bb045e45d71c963fbba1307f4b.zip |
refactor: optimum code and reduce duplicate
Diffstat (limited to 'src/ui/main_window/MainWindowFileSlotFunction.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowFileSlotFunction.cpp | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/src/ui/main_window/MainWindowFileSlotFunction.cpp b/src/ui/main_window/MainWindowFileSlotFunction.cpp index 12c06312..b94da713 100644 --- a/src/ui/main_window/MainWindowFileSlotFunction.cpp +++ b/src/ui/main_window/MainWindowFileSlotFunction.cpp @@ -557,37 +557,7 @@ void MainWindow::SlotFileVerify(const QString& path) { if (!result_analyse.GetUnknownSignatures().isEmpty() && Module::IsModuleActivate(kKeyServerSyncModuleID)) { - LOG_D() << "try to sync missing key info from server" - << result_analyse.GetUnknownSignatures(); - - QString fingerprint_list; - for (const auto& fingerprint : - result_analyse.GetUnknownSignatures()) { - fingerprint_list += fingerprint + "\n"; - } - - // Interaction with user - auto user_response = QMessageBox::question( - this, tr("Missing Keys"), - tr("Some signatures cannot be verified because the " - "corresponding keys are missing.\n\n" - "The following fingerprints are missing:\n%1\n\n" - "Would you like to fetch these keys from the key " - "server?") - .arg(fingerprint_list), - QMessageBox::Yes | QMessageBox::No); - - if (user_response == QMessageBox::Yes) { - CommonUtils::GetInstance() - ->ImportKeyByKeyServerSyncModule( - this, m_key_list_->GetCurrentGpgContextChannel(), - result_analyse.GetUnknownSignatures()); - } else { - QMessageBox::information( - this, tr("Verification Incomplete"), - tr("Verification was incomplete due to missing " - "keys. You can manually import the keys later.")); - } + slot_verifying_unknown_signature_helper(result_analyse); } this->slot_refresh_current_file_view(); |