diff options
author | Nils Achtergarde <[email protected]> | 2017-12-31 00:25:06 +0000 |
---|---|---|
committer | Nils Achtergarde <[email protected]> | 2017-12-31 00:25:06 +0000 |
commit | 19ac40b1974583197fe62f167442bb0d52e62b01 (patch) | |
tree | f32720f4cd1f1cfbb001f4d9a9ba90f7ea9baa20 /gpgcontext.cpp | |
parent | verify files readded (4ecc173307c8c1ed13f28b6955484a484a25402a to 7c874c55c82... (diff) | |
download | gpg4usb-19ac40b1974583197fe62f167442bb0d52e62b01.tar.gz gpg4usb-19ac40b1974583197fe62f167442bb0d52e62b01.zip |
recommit of ed8fb7fab377f277811368229b5d056e7edd860a (automatically restart gpg4usb after changing keydb path (and add note that restart is done))
Diffstat (limited to 'gpgcontext.cpp')
-rw-r--r-- | gpgcontext.cpp | 22 |
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); |