diff options
| author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-06-02 15:50:04 +0200 |
|---|---|---|
| committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-06-02 15:50:04 +0200 |
| commit | ed8fb7fab377f277811368229b5d056e7edd860a (patch) | |
| tree | 8562ac8287298cbcf0241d410efe70003450edf8 /gpgcontext.cpp | |
| parent | fix creation of windows registry key on import from GnuPG, if gnupg key doesn... (diff) | |
| download | gpg4usb-ed8fb7fab377f277811368229b5d056e7edd860a.tar.gz gpg4usb-ed8fb7fab377f277811368229b5d056e7edd860a.zip | |
automatically restart gpg4usb after changing keydb path (and add note that restart is done)
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@914 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'gpgcontext.cpp')
| -rw-r--r-- | gpgcontext.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 5884c14..7d0fbf2 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -71,7 +71,18 @@ GpgContext::GpgContext() #else QString gpgBin = appPath + "/bin/gpg"; #endif - QString 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());*/ @@ -81,6 +92,14 @@ GpgContext::GpgContext() gpgKeys.toLocal8Bit().constData()); 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 --> ? */ |
