aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/GpgCoreInit.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-12-02 17:10:01 +0000
committersaturneric <[email protected]>2024-12-02 19:32:59 +0000
commit0b5131cd895f6c4f7fc21af6740d03952a2463af (patch)
tree18d3eeac659e18346aa1477a318c47fecc094c0c /src/core/GpgCoreInit.cpp
parenttranslations: update zh_CN and de_DE (diff)
downloadGpgFrontend-0b5131cd895f6c4f7fc21af6740d03952a2463af.tar.gz
GpgFrontend-0b5131cd895f6c4f7fc21af6740d03952a2463af.zip
fix: qt5 build issues
Diffstat (limited to 'src/core/GpgCoreInit.cpp')
-rw-r--r--src/core/GpgCoreInit.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/GpgCoreInit.cpp b/src/core/GpgCoreInit.cpp
index 3ff293ae..4163f179 100644
--- a/src/core/GpgCoreInit.cpp
+++ b/src/core/GpgCoreInit.cpp
@@ -441,10 +441,21 @@ auto GetKeyDatabasesBySettings(QString& default_home_path)
auto key_db_list = KeyDatabaseListSO(key_db_list_so);
auto key_dbs = key_db_list.key_databases;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 1, 0)
key_dbs.removeIf(
[default_home_path](const KeyDatabaseItemSO& key_database) -> bool {
return key_database.path == default_home_path;
});
+#else
+ for (auto iter = key_dbs.begin(); iter != key_dbs.end();) {
+ if (iter->path == default_home_path) {
+ iter = key_dbs.erase(iter);
+ } else {
+ ++iter;
+ }
+ }
+#endif
+
key_db_list_so.Store(key_db_list.ToJson());
return key_dbs;
}