aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/GpgContext.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2023-04-04 16:15:54 +0000
committerSaturneric <[email protected]>2023-04-04 16:15:54 +0000
commitbef01eeb99351570d01a06e3db65cbd0cea5b102 (patch)
tree1eab214d697c214aad995816445bac8248ea85f9 /src/core/GpgContext.cpp
parentfeat: remove gnupg settings from general tab (diff)
downloadGpgFrontend-bef01eeb99351570d01a06e3db65cbd0cea5b102.tar.gz
GpgFrontend-bef01eeb99351570d01a06e3db65cbd0cea5b102.zip
feat: add custom gpgconf path support in context
Diffstat (limited to 'src/core/GpgContext.cpp')
-rw-r--r--src/core/GpgContext.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/GpgContext.cpp b/src/core/GpgContext.cpp
index f8dbebc6..47ff77c4 100644
--- a/src/core/GpgContext.cpp
+++ b/src/core/GpgContext.cpp
@@ -77,6 +77,14 @@ GpgContext::GpgContext(const GpgContextInitArgs &args) : args_(args) {
assert(check_gpg_error_2_err_code(err) == GPG_ERR_NO_ERROR);
}
+ if (args.custom_gpgconf && !args.custom_gpgconf_path.empty()) {
+ SPDLOG_DEBUG("set custom gpgconf path: {}", args.custom_gpgconf_path);
+ auto err =
+ gpgme_ctx_set_engine_info(_ctx_ref.get(), GPGME_PROTOCOL_GPGCONF,
+ args.custom_gpgconf_path.c_str(), nullptr);
+ assert(check_gpg_error_2_err_code(err) == GPG_ERR_NO_ERROR);
+ }
+
// set context offline mode
SPDLOG_DEBUG("gpg context offline mode: {}", args_.offline_mode);
gpgme_set_offline(_ctx_ref.get(), args_.offline_mode ? 1 : 0);