aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2013-02-17 16:37:39 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2013-02-17 16:37:39 +0000
commit65cbb5a39d564cad2ab402f33d6014fce50368c9 (patch)
treec6d9623b7eab58c72ae451d07358f2295771170b
parentone more step on notifications (diff)
downloadgpg4usb-65cbb5a39d564cad2ab402f33d6014fce50368c9.tar.gz
gpg4usb-65cbb5a39d564cad2ab402f33d6014fce50368c9.zip
further steps to get verifydialog done
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@1015 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--gpgcontext.cpp4
-rw-r--r--gpgcontext.h1
-rw-r--r--verifynotification.cpp11
3 files changed, 9 insertions, 7 deletions
diff --git a/gpgcontext.cpp b/gpgcontext.cpp
index d2109e2..4ec3e5a 100644
--- a/gpgcontext.cpp
+++ b/gpgcontext.cpp
@@ -75,6 +75,7 @@ GpgKeyList GpgContext::listKeys()
key.expired = false;
key.fpr = kkey.fingerprint();
key.id = kkey.id();
+ key.fullid = kkey.fullId();
key.name = kkey.name();
key.revoked = false;
keys.append(key);
@@ -176,11 +177,12 @@ GpgKey GpgContext::getKeyByFpr(QString fpr) {
/**
* note: privkey status is not returned
+ * TODO: Long Ids also should be supported
*/
GpgKey GpgContext::getKeyById(QString id) {
foreach (GpgKey key, mKeyList) {
- if(key.id == id) {
+ if(key.id == id || key.fullid == id) {
return key;
}
}
diff --git a/gpgcontext.h b/gpgcontext.h
index 5fc6b9e..86b988a 100644
--- a/gpgcontext.h
+++ b/gpgcontext.h
@@ -45,6 +45,7 @@ public:
privkey = false;
}
QString id;
+ QString fullid;
QString name;
QString email;
QString fpr;
diff --git a/verifynotification.cpp b/verifynotification.cpp
index 5e10640..b195972 100644
--- a/verifynotification.cpp
+++ b/verifynotification.cpp
@@ -240,6 +240,7 @@ void VerifyNotification::slotVerifyDone(int result)
qDebug() << "sig: " << vsig[9];
GpgKey key = mCtx->getKeyByFpr(vsig[9]);
+
verifyLabelText.append(key.name);
if (!key.email.isEmpty()) {
verifyLabelText.append("<"+key.email+">");
@@ -251,7 +252,7 @@ void VerifyNotification::slotVerifyDone(int result)
// verifyStatus=VERIFY_ERROR_CRITICAL;
// verifyLabelText.append("no sig found");
- //textIsSigned = 3;
+ textIsSigned = 3;
//verifyStatus=VERIFY_ERROR_CRITICAL;
verifyLabelText.append("No signature found ");
@@ -263,19 +264,17 @@ void VerifyNotification::slotVerifyDone(int result)
}*/
} else if (msg.startsWith(QLatin1String("BADSIG"))) {
- int sigpos = msg.indexOf( ' ', 7);
+ int sigpos = msg.indexOf( ' ', 8);
// name not used...?
- QString name = msg.mid(sigpos + 1).replace(QLatin1Char('<'), QLatin1String("&lt;"));
+ //QString name = msg.mid(sigpos + 1).replace(QLatin1Char('<'), QLatin1String("&lt;"));
QString id = msg.mid(7, sigpos - 7);
- qDebug() << "id:" << id << "|name:" << name;
-
textIsSigned = 3;
verifyStatus=VERIFY_ERROR_CRITICAL;
GpgKey key = mCtx->getKeyById(id);
verifyLabelText.append(key.name);
if (!key.email.isEmpty()) {
- verifyLabelText.append("<"+key.email+">");
+ verifyLabelText.append("&lt;"+key.email+"&gt;");
}
break;