aboutsummaryrefslogtreecommitdiffstats
path: root/gpgcontext.cpp
diff options
context:
space:
mode:
authorUbbo Veentjer <[email protected]>2017-12-31 00:32:47 +0000
committerUbbo Veentjer <[email protected]>2017-12-31 00:32:47 +0000
commit5c7dfbe981005580f667b66557b541ce011ae5d3 (patch)
treece27f24e9dea7c8cd45e64ea5eef570e98743599 /gpgcontext.cpp
parentfix npe (diff)
parentrecommit of dbe66cf033cf8b450b74e2e3fd510310169bce24 (minor changes for keydb... (diff)
downloadgpg4usb-5c7dfbe981005580f667b66557b541ce011ae5d3.tar.gz
gpg4usb-5c7dfbe981005580f667b66557b541ce011ae5d3.zip
Merge branch 'master' of https://github.com/gpg4usb/gpg4usb
Diffstat (limited to 'gpgcontext.cpp')
-rw-r--r--gpgcontext.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/gpgcontext.cpp b/gpgcontext.cpp
index 8f7c07e..45e053b 100644
--- a/gpgcontext.cpp
+++ b/gpgcontext.cpp
@@ -68,7 +68,18 @@ GpgContext::GpgContext()
#else
gpgBin = appPath + "/bin/gpg";
#endif
- gpgKeys = appPath + "/keydb";
+
+ QSettings settings;
+ QString accKeydbPath = settings.value("gpgpaths/keydbpath").toString();
+ QString gpgKeys = appPath + "/keydb/"+accKeydbPath;
+
+ if (accKeydbPath != "") {
+ if (!QDir(gpgKeys).exists()) {
+ QMessageBox::critical(0,tr("keydb path"),tr("Didn't find keydb directory. Switching to gpg4usb's default keydb directory for this session."));
+ gpgKeys = appPath + "/keydb";
+ }
+ }
+
/* err = gpgme_ctx_set_engine_info(mCtx, GPGME_PROTOCOL_OpenPGP,
gpgBin.toUtf8().constData(),
gpgKeys.toUtf8().constData());*/
@@ -79,6 +90,15 @@ GpgContext::GpgContext()
checkErr(err);
#endif
+ gpgme_engine_info_t engineInfo;
+ engineInfo = gpgme_ctx_get_engine_info(mCtx);
+
+
+ while (engineInfo !=NULL ) {
+ qDebug() << gpgme_get_protocol_name(engineInfo->protocol);
+ engineInfo=engineInfo->next;
+ }
+
/** Setting the output type must be done at the beginning */
/** think this means ascii-armor --> ? */
gpgme_set_armor(mCtx, 1);