aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-22 14:02:15 +0000
committersaturneric <[email protected]>2024-01-22 14:02:15 +0000
commit904521c89de0bedb2db1cf36e3cba3b928eaa65a (patch)
tree3a83611183e09b453351987d930398d24bb92afa
parentfix: stop reading all data into memory at file hash calculation (diff)
downloadGpgFrontend-904521c89de0bedb2db1cf36e3cba3b928eaa65a.tar.gz
GpgFrontend-904521c89de0bedb2db1cf36e3cba3b928eaa65a.zip
fix: improve ui and solve discovered bugs at version checking module
-rw-r--r--src/core/GpgFrontendCore.cpp5
-rw-r--r--src/module/integrated/version_checking_module/SoftwareVersion.cpp7
-rw-r--r--src/module/integrated/version_checking_module/VersionCheckTask.cpp6
-rw-r--r--src/ui/dialog/import_export/KeyServerImportDialog.cpp4
4 files changed, 13 insertions, 9 deletions
diff --git a/src/core/GpgFrontendCore.cpp b/src/core/GpgFrontendCore.cpp
index 2508f4e7..82ed09f4 100644
--- a/src/core/GpgFrontendCore.cpp
+++ b/src/core/GpgFrontendCore.cpp
@@ -27,8 +27,3 @@
*/
#include "core/GpgFrontendCore.h"
-
-#ifndef MACOS
-// mimalloc
-#include <mimalloc-new-delete.h>
-#endif
diff --git a/src/module/integrated/version_checking_module/SoftwareVersion.cpp b/src/module/integrated/version_checking_module/SoftwareVersion.cpp
index 117212cb..e4077d65 100644
--- a/src/module/integrated/version_checking_module/SoftwareVersion.cpp
+++ b/src/module/integrated/version_checking_module/SoftwareVersion.cpp
@@ -32,7 +32,7 @@
namespace GpgFrontend::Module::Integrated::VersionCheckingModule {
-bool VersionCheckingModule::SoftwareVersion::NeedUpgrade() const {
+auto VersionCheckingModule::SoftwareVersion::NeedUpgrade() const -> bool {
MODULE_LOG_DEBUG("compair version current {} latest {}, result {}",
current_version, latest_version,
CompareSoftwareVersion(current_version, latest_version));
@@ -45,12 +45,13 @@ bool VersionCheckingModule::SoftwareVersion::NeedUpgrade() const {
CompareSoftwareVersion(current_version, latest_version) < 0;
}
-bool VersionCheckingModule::SoftwareVersion::VersionWithdrawn() const {
+auto VersionCheckingModule::SoftwareVersion::VersionWithdrawn() const -> bool {
return loading_done && !current_version_publish_in_remote &&
current_version_is_a_prerelease && !current_version_is_drafted;
}
-bool VersionCheckingModule::SoftwareVersion::CurrentVersionReleased() const {
+auto VersionCheckingModule::SoftwareVersion::CurrentVersionReleased() const
+ -> bool {
return loading_done && current_version_publish_in_remote;
}
} // namespace GpgFrontend::Module::Integrated::VersionCheckingModule \ No newline at end of file
diff --git a/src/module/integrated/version_checking_module/VersionCheckTask.cpp b/src/module/integrated/version_checking_module/VersionCheckTask.cpp
index 261ab1ca..34827838 100644
--- a/src/module/integrated/version_checking_module/VersionCheckTask.cpp
+++ b/src/module/integrated/version_checking_module/VersionCheckTask.cpp
@@ -101,6 +101,7 @@ void VersionCheckTask::slot_parse_latest_version_info() {
QString current_version_url =
"https://api.github.com/repos/saturneric/gpgfrontend/releases/tags/" +
current_version_;
+ MODULE_LOG_DEBUG("current version info query url: {}", current_version_url);
QNetworkRequest current_request;
current_request.setUrl(QUrl(current_version_url));
@@ -124,7 +125,11 @@ void VersionCheckTask::slot_parse_current_version_info() {
MODULE_LOG_ERROR(
"current version request network error, null reply object");
}
+
version_.current_version_publish_in_remote = false;
+
+ // loading done
+ version_.loading_done = true;
} else {
version_.current_version_publish_in_remote = true;
current_reply_bytes_ = current_reply_->readAll();
@@ -135,7 +140,6 @@ void VersionCheckTask::slot_parse_current_version_info() {
bool current_draft = current_reply_json["draft"].toBool();
version_.latest_prerelease_version_from_remote = current_prerelease;
version_.latest_draft_from_remote = current_draft;
-
// loading done
version_.loading_done = true;
} else {
diff --git a/src/ui/dialog/import_export/KeyServerImportDialog.cpp b/src/ui/dialog/import_export/KeyServerImportDialog.cpp
index 49438c44..599d512d 100644
--- a/src/ui/dialog/import_export/KeyServerImportDialog.cpp
+++ b/src/ui/dialog/import_export/KeyServerImportDialog.cpp
@@ -366,6 +366,10 @@ void KeyServerImportDialog::slot_import() {
}
if (!key_ids.empty()) {
SlotImport(key_ids, key_server_combo_box_->currentText());
+ } else {
+ QMessageBox::warning(
+ this, tr("Warning"),
+ tr("Please select one KeyPair before doing this operation."));
}
}