aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt9
-rw-r--r--src/GpgFrontendBuildInfo.h.in8
-rw-r--r--src/core/utils/BuildInfoUtils.cpp4
-rw-r--r--src/core/utils/BuildInfoUtils.h8
-rw-r--r--src/core/utils/CommonUtils.h6
-rw-r--r--src/ui/main_window/MainWindowSlotFunction.cpp2
6 files changed, 32 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b78ff062..67767e89 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,6 +69,9 @@ option(GPGFRONTEND_XCODE_APPID "GpgFrontend Apple AppID" "NONE")
option(GPGFRONTEND_XCODE_PROVISIONING_PROFILE_UUID "GpgFrontend ProvisioningProfile UUID" "NONE")
option(GPGFRONTEND_XCODE_ENABLE_SANDBOX "Enable SandBox For Xcode Build" OFF)
+# check options
+option(GPGFRONTEND_CHECK_RELEASE_COMMIT_HASH "Enable checking on commit hash from the GitHub release" OFF)
+
if(GPGFRONTEND_BUILD_APP_IMAGE)
set(BUILD_APP_IMAGE 1)
endif()
@@ -92,6 +95,12 @@ if(GPGFRONTEND_BUILD_MODULES)
set(BUILD_MODULES 1)
endif()
+if(GPGFRONTEND_CHECK_RELEASE_COMMIT_HASH)
+ set(CHECK_RELEASE_COMMIT_HASH 1)
+else()
+ set(CHECK_RELEASE_COMMIT_HASH 0)
+endif()
+
# C++
# options for ccache
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 "