diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/function/gpg/GpgKeyOpera.cpp | 6 | ||||
-rw-r--r-- | src/core/struct/cache_object/AllFavoriteKeyPairsCO.h | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/core/function/gpg/GpgKeyOpera.cpp b/src/core/function/gpg/GpgKeyOpera.cpp index f5027d4c..6898b355 100644 --- a/src/core/function/gpg/GpgKeyOpera.cpp +++ b/src/core/function/gpg/GpgKeyOpera.cpp @@ -110,9 +110,15 @@ void GpgKeyOpera::GenerateRevokeCert(const GpgKey& key, << "text:" << revocation_reason_text; // dealing with reason text +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 4) auto reason_text_lines = GpgFrontend::SecureCreateSharedObject<QList<QString>>( revocation_reason_text.split('\n', Qt::SkipEmptyParts).toVector()); +#else + auto reason_text_lines = + GpgFrontend::SecureCreateSharedObject<QVector<QString>>( + revocation_reason_text.split('\n', Qt::SkipEmptyParts).toVector()); +#endif const auto app_path = Module::RetrieveRTValueTypedOrDefault<>( "core", "gpgme.ctx.app_path", QString{}); diff --git a/src/core/struct/cache_object/AllFavoriteKeyPairsCO.h b/src/core/struct/cache_object/AllFavoriteKeyPairsCO.h index 1086e2e6..61875f1c 100644 --- a/src/core/struct/cache_object/AllFavoriteKeyPairsCO.h +++ b/src/core/struct/cache_object/AllFavoriteKeyPairsCO.h @@ -60,6 +60,7 @@ struct AllFavoriteKeyPairsCO { [[nodiscard]] auto ToJson() const -> QJsonObject { QJsonObject j; auto j_key_dbs = QJsonArray(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) for (const auto& k : key_dbs.asKeyValueRange()) { QJsonObject o; o["key_db_name"] = k.first; @@ -69,6 +70,17 @@ struct AllFavoriteKeyPairsCO { j["key_dbs"] = j_key_dbs; return j; } +#else + for (auto it = key_dbs.keyValueBegin(); it != key_dbs.keyValueEnd(); ++it) { + QJsonObject o; + o["key_db_name"] = it->first; + o["key_db"] = it->second.ToJson(); + j_key_dbs.append(o); + } + j["key_dbs"] = j_key_dbs; + return j; + } +#endif }; } // namespace GpgFrontend
\ No newline at end of file |