From 26d3bf7553f7d380753f7eafd99b5ae61c077be3 Mon Sep 17 00:00:00 2001 From: ubbo Date: Sun, 31 Jan 2010 17:46:08 +0000 Subject: recognize secret keys for keydetailsdialog git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@257 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- context.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'context.cpp') diff --git a/context.cpp b/context.cpp index b6a781e..cf1f64e 100644 --- a/context.cpp +++ b/context.cpp @@ -153,7 +153,13 @@ gpgme_key_t Context::getKeyDetails(QString uid) { gpgme_key_t key; - gpgme_get_key (mCtx, uid.toAscii().constData(), &key, 0); + // try secret + gpgme_get_key (mCtx, uid.toAscii().constData(), &key, 1); + // ok, its a public key + if(!key) { + gpgme_get_key (mCtx, uid.toAscii().constData(), &key, 0); + } + return key; } -- cgit