aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/utils/GpgUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/utils/GpgUtils.cpp')
-rw-r--r--src/core/utils/GpgUtils.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/utils/GpgUtils.cpp b/src/core/utils/GpgUtils.cpp
index 38eef081..c4478f6f 100644
--- a/src/core/utils/GpgUtils.cpp
+++ b/src/core/utils/GpgUtils.cpp
@@ -230,12 +230,17 @@ auto GetKeyDatabasesBySettings() -> QContainer<KeyDatabaseItemSO> {
if (key_dbs.empty()) {
KeyDatabaseItemSO key_db;
- auto default_home_path = Module::RetrieveRTValueTypedOrDefault<>(
+ auto home_path = Module::RetrieveRTValueTypedOrDefault<>(
"core", "gpgme.ctx.default_database_path", QString{});
+ if (GlobalSettingStation::GetInstance().IsProtableMode()) {
+ home_path = QDir(GlobalSettingStation::GetInstance().GetAppDir())
+ .relativeFilePath(home_path);
+ }
+
key_db.channel = 0;
key_db.name = "DEFAULT";
- key_db.path = default_home_path;
+ key_db.path = home_path;
key_dbs.append(key_db);
}