aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/utils/GpgUtils.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-01-21 22:59:35 +0000
committersaturneric <[email protected]>2025-01-21 22:59:35 +0000
commit56140c6bdc567bf85c5916a36d707196a52b9272 (patch)
tree32c216f1ac572649d44568dd886130ac0503114e /src/core/utils/GpgUtils.cpp
parentfeat: enhance key db functions (diff)
downloadGpgFrontend-56140c6bdc567bf85c5916a36d707196a52b9272.tar.gz
GpgFrontend-56140c6bdc567bf85c5916a36d707196a52b9272.zip
fix: make app fully portable
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);
}