From 5b24ce3f27531da4cc63707c5010e746f7c5dcef Mon Sep 17 00:00:00 2001 From: ubbo Date: Sun, 30 Sep 2012 14:42:54 +0000 Subject: more verifyparsing from kgpgme, kind of works in verifydetailsdialog now git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@990 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgcontext.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'gpgcontext.cpp') diff --git a/gpgcontext.cpp b/gpgcontext.cpp index abc9d03..959e8e9 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -173,7 +173,7 @@ KgpgCore::KgpgKey GpgContext::getKeyDetails(QString uid) { GpgKeyList GpgContext::listKeys() { - KgpgInterface::readPublicKeys(); + //KgpgInterface::readPublicKeys(); GpgKeyList keys; @@ -313,12 +313,11 @@ sigTimeMessage(const QString &sigtime) if (!stamp.isValid()) return QString(); -/* return tr("first argument is formatted date, second argument is formatted time", - "The signature was created at %1 %2", - KGlobal::locale()->formatDate(stamp.date(), KLocale::LongDate), - KGlobal::locale()->formatTime(stamp.time(), KLocale::LongDate)) + - QLatin1String("
");*/ - return "todo"; + return QObject::tr("The signature was created at %1 %2") + .arg(stamp.date().toString()) + .arg(stamp.time().toString() + QLatin1String("
") + , "first argument is formatted date, second argument is formatted time"); + } QString GpgContext::getReport(const QStringList &log) @@ -346,6 +345,22 @@ QString GpgContext::getReport(const QStringList &log) const QStringList vsig = msg.mid(9).split(QLatin1Char(' '), QString::SkipEmptyParts); Q_ASSERT(vsig.count() >= 10); + //result += vsig[9]; + + GpgKey key = getKeyByFpr(vsig[9]); + + // ignore for now if this is signed with the primary id (vsig[0] == vsig[9]) or not + if (key.email.isEmpty()) { + result += tr("Good signature from:
%1
Key ID: %2
") + .arg(key.name).arg(vsig[9]); + } else { + result += tr("Good signature from: NAME , Key ID: HEXID", + "Good signature from:
%1 <%2>
Key ID: %3
") + .arg(key.name).arg(key.email).arg(vsig[9]); + } + result += sigTimeMessage(vsig[2]); + + /* const KGpgKeyNode *node = model->findKeyNode(vsig[9]); if (node != NULL) { -- cgit v1.2.3