diff options
author | saturneric <[email protected]> | 2025-05-01 09:32:25 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-05-01 09:32:25 +0000 |
commit | b7ad78faf6ef31e677981646798cbf3d45dda598 (patch) | |
tree | 32dfa2c3df273c31efee8b699d7d58c32e40bf5a /src | |
parent | fix: tacking modules repo (diff) | |
download | GpgFrontend-b7ad78faf6ef31e677981646798cbf3d45dda598.tar.gz GpgFrontend-b7ad78faf6ef31e677981646798cbf3d45dda598.zip |
feat: ad cmake option GPGFRONTEND_CHECK_RELEASE_COMMIT_HASH
Diffstat (limited to 'src')
-rw-r--r-- | src/GpgFrontendBuildInfo.h.in | 8 | ||||
-rw-r--r-- | src/core/utils/BuildInfoUtils.cpp | 4 | ||||
-rw-r--r-- | src/core/utils/BuildInfoUtils.h | 8 | ||||
-rw-r--r-- | src/core/utils/CommonUtils.h | 6 | ||||
-rw-r--r-- | src/ui/main_window/MainWindowSlotFunction.cpp | 2 |
5 files changed, 23 insertions, 5 deletions
diff --git a/src/GpgFrontendBuildInfo.h.in b/src/GpgFrontendBuildInfo.h.in index 1bedda93..6deaaccf 100644 --- a/src/GpgFrontendBuildInfo.h.in +++ b/src/GpgFrontendBuildInfo.h.in @@ -58,4 +58,10 @@ * @brief Network * */ -#define HTTP_REQUEST_USER_AGENT "@HTTP_REQUEST_USER_AGENT@"
\ No newline at end of file +#define HTTP_REQUEST_USER_AGENT "@HTTP_REQUEST_USER_AGENT@" + +/** + * @brief Checking + * + */ +#define CHECK_RELEASE_COMMIT_HASH "@CHECK_RELEASE_COMMIT_HASH@"
\ No newline at end of file diff --git a/src/core/utils/BuildInfoUtils.cpp b/src/core/utils/BuildInfoUtils.cpp index 43d8b71d..3632a92a 100644 --- a/src/core/utils/BuildInfoUtils.cpp +++ b/src/core/utils/BuildInfoUtils.cpp @@ -67,4 +67,8 @@ auto GetProjectLibarchiveVersion() -> QString { } auto GetHttpRequestUserAgent() -> QString { return HTTP_REQUEST_USER_AGENT; } + +auto GPGFRONTEND_CORE_EXPORT IsCheckReleaseCommitHash() -> bool { + return QString::fromLatin1(CHECK_RELEASE_COMMIT_HASH).toInt() == 1; +} }; // namespace GpgFrontend
\ No newline at end of file diff --git a/src/core/utils/BuildInfoUtils.h b/src/core/utils/BuildInfoUtils.h index 33d922f1..8d7f1af2 100644 --- a/src/core/utils/BuildInfoUtils.h +++ b/src/core/utils/BuildInfoUtils.h @@ -116,4 +116,12 @@ auto GPGFRONTEND_CORE_EXPORT GetProjectGpgMEVersion() -> QString; */ auto GPGFRONTEND_CORE_EXPORT GetHttpRequestUserAgent() -> QString; +/** + * @brief + * + * @return true + * @return false + */ +auto GPGFRONTEND_CORE_EXPORT IsCheckReleaseCommitHash() -> bool; + } // namespace GpgFrontend
\ No newline at end of file diff --git a/src/core/utils/CommonUtils.h b/src/core/utils/CommonUtils.h index a0b46d3c..3c56bfe5 100644 --- a/src/core/utils/CommonUtils.h +++ b/src/core/utils/CommonUtils.h @@ -105,7 +105,7 @@ auto GPGFRONTEND_CORE_EXPORT IsEmailAddress(const QString &) -> bool; * @param b * @return auto */ -auto GPGFRONTEND_CORE_EXPORT -GFSoftwareVersionGreaterThan(const QString &a, const QString &b) -> bool; - +auto GPGFRONTEND_CORE_EXPORT GFSoftwareVersionGreaterThan(const QString &a, + const QString &b) + -> bool; } // namespace GpgFrontend
\ No newline at end of file diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index b19c15e8..e2473136 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -278,7 +278,7 @@ void MainWindow::slot_version_upgrade_notify() { [=]() { (new AboutDialog(tr("Update"), this))->show(); }); statusBar()->addPermanentWidget(b); - } else if (is_git_commit_hash_mismatch && !IsFlatpakENV()) { + } else if (is_git_commit_hash_mismatch && IsCheckReleaseCommitHash()) { QMessageBox::information( this, tr("Commit Hash Mismatch"), tr("The current version's commit hash does not match the official " |