aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowSlotFunction.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-07-29 19:29:56 +0000
committersaturneric <[email protected]>2024-07-29 19:29:56 +0000
commitfa90ec4b5315b9e70a44a9625c143ce253f0e885 (patch)
tree8ffa82e33522de03974d6d0289aa831b4fd6ebdf /src/ui/main_window/MainWindowSlotFunction.cpp
parentfix: correct urls at appdata.xml (diff)
parentMerge branch 'develop' of github.com:saturneric/GpgFrontend into develop (diff)
downloadGpgFrontend-fa90ec4b5315b9e70a44a9625c143ce253f0e885.tar.gz
GpgFrontend-fa90ec4b5315b9e70a44a9625c143ce253f0e885.zip
Merge branch 'develop'
Diffstat (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp')
-rw-r--r--src/ui/main_window/MainWindowSlotFunction.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp
index 7d50b85a..f1754be7 100644
--- a/src/ui/main_window/MainWindowSlotFunction.cpp
+++ b/src/ui/main_window/MainWindowSlotFunction.cpp
@@ -63,14 +63,14 @@ void MainWindow::slot_append_selected_keys() {
auto key_ids = m_key_list_->GetSelected();
if (key_ids->empty()) {
- GF_UI_LOG_ERROR("no key is selected to export");
+ qCWarning(ui, "no key is selected to export");
return;
}
auto key = GpgKeyGetter::GetInstance().GetKey(key_ids->front());
if (!key.IsGood()) {
- GF_UI_LOG_ERROR("selected key for exporting is invalid, key id: {}",
- key_ids->front());
+ qCWarning(ui) << "selected key for exporting is invalid, key id: "
+ << key_ids->front();
return;
}
@@ -88,7 +88,7 @@ void MainWindow::slot_append_keys_create_datetime() {
auto key_ids = m_key_list_->GetSelected();
if (key_ids->empty()) {
- GF_UI_LOG_ERROR("no key is selected");
+ qCWarning(ui, "no key is selected");
return;
}
@@ -112,7 +112,7 @@ void MainWindow::slot_append_keys_expire_datetime() {
auto key_ids = m_key_list_->GetSelected();
if (key_ids->empty()) {
- GF_UI_LOG_ERROR("no key is selected");
+ qCWarning(ui, "no key is selected");
return;
}
@@ -204,8 +204,9 @@ void MainWindow::slot_add_key_2_favourite() {
if (key_ids->empty()) return;
auto key = GpgKeyGetter::GetInstance().GetKey(key_ids->front());
- CommonUtils::GetInstance()->AddKey2Favourtie(key);
+ if (!key.IsGood()) return;
+ CommonUtils::GetInstance()->AddKey2Favourtie(key);
emit SignalUIRefresh();
}
@@ -263,15 +264,14 @@ void MainWindow::SlotOpenFile(const QString& path) {
}
void MainWindow::slot_version_upgrade_notify() {
- GF_UI_LOG_DEBUG(
+ qCDebug(
+ ui,
"slot version upgrade notify called, checking version info from rt...");
+
auto is_loading_done = Module::RetrieveRTValueTypedOrDefault<>(
kVersionCheckingModuleID, "version.loading_done", false);
-
- GF_UI_LOG_DEBUG("checking version info from rt, is loading done state: {}",
- is_loading_done);
if (!is_loading_done) {
- GF_UI_LOG_ERROR("invalid version info from rt, loading hasn't done yet");
+ qCWarning(ui, "invalid version info from rt, loading hasn't done yet");
return;
}
@@ -287,12 +287,6 @@ void MainWindow::slot_version_upgrade_notify() {
auto latest_version = Module::RetrieveRTValueTypedOrDefault<>(
kVersionCheckingModuleID, "version.latest_version", QString{});
- GF_UI_LOG_DEBUG(
- "got version info from rt, need upgrade: {}, with drawn: {}, "
- "current version released: {}",
- is_need_upgrade, is_current_a_withdrawn_version,
- is_current_version_released);
-
if (is_need_upgrade) {
statusBar()->showMessage(
tr("GpgFrontend Upgradeable (New Version: %1).").arg(latest_version),