diff options
author | saturneric <[email protected]> | 2025-01-27 22:12:00 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-01-27 22:12:00 +0000 |
commit | a66d868f500c0bd94fe9783172ac3d17b1dbb6f5 (patch) | |
tree | 3c2c07e0ec717fac5beec08d9678bd311a84e134 /src/ui/main_window/MainWindowSlotFunction.cpp | |
parent | refactor: reduce code duplication of gnupg file operations (diff) | |
download | GpgFrontend-a66d868f500c0bd94fe9783172ac3d17b1dbb6f5.tar.gz GpgFrontend-a66d868f500c0bd94fe9783172ac3d17b1dbb6f5.zip |
refactor: reduce code duplication of gnupg operations
Diffstat (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowSlotFunction.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index a5a56c1f..825f74f5 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -47,6 +47,7 @@ #include "ui/dialog/help/AboutDialog.h" #include "ui/dialog/import_export/KeyUploadDialog.h" #include "ui/dialog/keypair_details/KeyDetailsDialog.h" +#include "ui/function/GpgOperaHelper.h" #include "ui/function/SetOwnerTrustLevel.h" #include "ui/struct/GpgOperaResult.h" #include "ui/widgets/FindWidget.h" @@ -559,6 +560,7 @@ void MainWindow::slot_result_analyse_show_helper( const QContainer<GpgOperaResult>& opera_results) { if (opera_results.empty()) { slot_refresh_info_board(0, ""); + return; } int overall_status = 1; // Initialize to OK @@ -1093,4 +1095,20 @@ auto MainWindow::handle_module_error(QMap<QString, QString> p) -> bool { return false; } +void MainWindow::slot_gpg_opera_buffer_show_helper( + const QContainer<GpgOperaResult>& results) { + for (const auto& result : results) { + if (result.o_buffer.Empty()) continue; + edit_->SlotFillTextEditWithText(result.o_buffer.ConvertToQByteArray()); + } +} + +void MainWindow::exec_operas_helper( + const QString& task, + const QSharedPointer<GpgOperaContextBasement>& contexts) { + GpgOperaHelper::WaitForMultipleOperas(this, task, contexts->operas); + slot_gpg_opera_buffer_show_helper(contexts->opera_results); + slot_result_analyse_show_helper(contexts->opera_results); +} + } // namespace GpgFrontend::UI |