diff options
author | Saturneric <[email protected]> | 2023-01-07 14:20:07 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2023-01-07 14:20:07 +0000 |
commit | 225d435423888c38e0c75f63c1d7a41283839bd5 (patch) | |
tree | 4c575375dde858e9391e585f9bf47d65090c70cc /src/ui/main_window/MainWindow.cpp | |
parent | fix: continue to solve ubuntu 18.04 build issues (diff) | |
download | GpgFrontend-225d435423888c38e0c75f63c1d7a41283839bd5.tar.gz GpgFrontend-225d435423888c38e0c75f63c1d7a41283839bd5.zip |
feat: add advanced gnupg operations
1.fix some issues
2. add advanced gnupg operations
3. add configurations information in Gnupg Help Tab
Diffstat (limited to 'src/ui/main_window/MainWindow.cpp')
-rw-r--r-- | src/ui/main_window/MainWindow.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp index b0273d86..a5df66f0 100644 --- a/src/ui/main_window/MainWindow.cpp +++ b/src/ui/main_window/MainWindow.cpp @@ -29,6 +29,7 @@ #include "MainWindow.h" #include "core/function/GlobalSettingStation.h" +#include "core/function/gpg/GpgAdvancedOperator.h" #include "ui/SignalStation.h" #include "ui/UserInterfaceUtils.h" #include "ui/struct/SettingsObject.h" @@ -128,6 +129,30 @@ void MainWindow::Init() noexcept { ->PostTask(version_task); } + // before application exit + connect(qApp, &QCoreApplication::aboutToQuit, this, []() { + LOG(INFO) << "about to quit process started"; + + auto &settings = GlobalSettingStation::GetInstance().GetUISettings(); + try { + bool clear_gpg_password_cache = + settings.lookup("general.clear_gpg_password_cache"); + + if (clear_gpg_password_cache) { + if (GpgFrontend::GpgAdvancedOperator::GetInstance() + .ClearGpgPasswordCache()) { + LOG(INFO) << "clear gpg password cache done"; + } else { + LOG(ERROR) << "clear gpg password cache error"; + } + } + + } catch (...) { + LOG(ERROR) << _("Setting Operation Error") + << _("clear_gpg_password_cache"); + } + }); + } catch (...) { LOG(FATAL) << _("Critical error occur while loading GpgFrontend."); QMessageBox::critical(nullptr, _("Loading Failed"), |