diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-08-02 00:05:44 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-08-02 00:05:44 +0000 |
commit | 4149c8712b45791605ea3502c00baa94b0948f33 (patch) | |
tree | e3e9d021b5d8e73a36ed5b2fda48b0fe2dc81e38 /gpgcontext.cpp | |
parent | start removing gpgme (diff) | |
download | gpg4usb-4149c8712b45791605ea3502c00baa94b0948f33.tar.gz gpg4usb-4149c8712b45791605ea3502c00baa94b0948f33.zip |
try to integrate gpg wrapper from kgpg - broken now
git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2-mac@921 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'gpgcontext.cpp')
-rw-r--r-- | gpgcontext.cpp | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 251d372..534ddea 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -20,7 +20,8 @@ */ #include "gpgcontext.h" - +#include "kgpg/gpgproc.h" +#include "kgpg/klinebufferedprocess.h" #ifdef _WIN32 #include <windows.h> #include <unistd.h> /* contains read/write */ @@ -43,33 +44,33 @@ GpgContext::GpgContext() * subsystem in GPGME. (from the info page) */ #ifdef Q_WS_WIN - QString gpgBin = appPath + "/bin/gpg.exe"; - QString gpgKeys = appPath + "/keydb"; + gpgBin = appPath + "/bin/gpg.exe"; + gpgKeys = appPath + "/keydb"; #endif #ifdef Q_WS_MAC - QString gpgBin = appPath + "/bin/gpg-mac.app"; + gpgBin = appPath + "/bin/gpg-mac.app"; - QString gpgKeys = appPath + "/keydb"; + gpgKeys = appPath + "/keydb"; qDebug() << "gpg bin:" << gpgBin; qDebug() << "gpg keydb: " << gpgKeys; #endif #ifdef Q_WS_X11 - QString gpgBin = appPath + "/bin/gpg"; - QString gpgKeys = appPath + "/keydb"; + gpgBin = appPath + "/bin/gpg"; + gpgKeys = appPath + "/keydb"; #endif QStringList args; args << "--homedir" << gpgKeys << "--list-keys"; - QProcess gpg; +/* QProcess gpg; gpg.setProcessChannelMode(QProcess::MergedChannels); gpg.start(gpgBin, args); gpg.waitForFinished(-1); qDebug() << "huhu" << gpg.readAll(); - +*/ connect(this,SIGNAL(keyDBChanged()),this,SLOT(refreshKeyList())); refreshKeyList(); } @@ -211,6 +212,20 @@ GpgKeyList GpgContext::listKeys() GpgKeyList keys; + GPGProc process(this, gpgBin); +/* process << + QLatin1String("--with-colons") << + QLatin1String("--with-fingerprint") << + QLatin1String("--fixed-list-mode") << + QLatin1String("--list-keys"); + + process.setOutputChannelMode(KProcess::MergedChannels); + + process.start(); + process.waitForFinished(-1);*/ + //while (item == process->) +// return readPublicKeysProcess(process, NULL); + //TODO dont run the loop more often than necessary // list all keys ( the 0 is for all ) |