diff options
author | saturneric <[email protected]> | 2024-12-02 16:05:12 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-12-02 16:05:12 +0000 |
commit | 3349a56ea04dd32033bc9d2d8b12f92142768bba (patch) | |
tree | 9d6cdb0317662c7f32ab4a1f77f3a313e3424451 /src/ui/main_window/MainWindow.cpp | |
parent | feat: skip version notifying on developing or testing build (diff) | |
download | GpgFrontend-3349a56ea04dd32033bc9d2d8b12f92142768bba.tar.gz GpgFrontend-3349a56ea04dd32033bc9d2d8b12f92142768bba.zip |
fix: settings prohibit version checking at start not working
Diffstat (limited to 'src/ui/main_window/MainWindow.cpp')
-rw-r--r-- | src/ui/main_window/MainWindow.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp index 2f37e95b..d191e268 100644 --- a/src/ui/main_window/MainWindow.cpp +++ b/src/ui/main_window/MainWindow.cpp @@ -131,24 +131,30 @@ void MainWindow::Init() noexcept { info_board_->AssociateTabWidget(edit_->TabWidget()); - Module::ListenRTPublishEvent( - this, kVersionCheckingModuleID, "version.loading_done", - [=](Module::Namespace, Module::Key, int, std::any) { - FLOG_D( - "version-checking version.loading_done changed, calling slot " - "version upgrade"); - this->slot_version_upgrade_notify(); - }); - // loading process is done emit SignalLoaded(); Module::TriggerEvent("APPLICATION_LOADED"); + // check version information + auto settings = GlobalSettingStation::GetInstance().GetSettings(); + auto prohibit_update_checking = + settings.value("network/prohibit_update_checking").toBool(); + if (!prohibit_update_checking) { + Module::ListenRTPublishEvent( + this, kVersionCheckingModuleID, "version.loading_done", + [=](Module::Namespace, Module::Key, int, std::any) { + FLOG_D( + "version-checking version.loading_done changed, calling slot " + "version upgrade"); + this->slot_version_upgrade_notify(); + }); + Module::TriggerEvent("CHECK_APPLICATION_VERSION"); + } + // recover unsaved page from cache if it exists recover_editor_unsaved_pages_from_cache(); // check if need to open wizard window - auto settings = GlobalSettingStation::GetInstance().GetSettings(); auto show_wizard = settings.value("wizard/show_wizard", true).toBool(); if (show_wizard) slot_start_wizard(); |