diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-09-30 14:42:54 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-09-30 14:42:54 +0000 |
commit | 5b24ce3f27531da4cc63707c5010e746f7c5dcef (patch) | |
tree | 368602e891c2c3b4ecefcdc43c26ce0a1d079853 | |
parent | bit more verifyparsing from kgpgme, still not fine (diff) | |
download | gpg4usb-5b24ce3f27531da4cc63707c5010e746f7c5dcef.tar.gz gpg4usb-5b24ce3f27531da4cc63707c5010e746f7c5dcef.zip |
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
-rw-r--r-- | gpgcontext.cpp | 29 | ||||
-rw-r--r-- | gpgcontext.h | 2 | ||||
-rw-r--r-- | verifydetailsdialog.cpp | 2 | ||||
-rw-r--r-- | verifykeydetailbox.cpp | 2 |
4 files changed, 25 insertions, 10 deletions
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("<br/>");*/ - return "todo"; + return QObject::tr("The signature was created at %1 %2") + .arg(stamp.date().toString()) + .arg(stamp.time().toString() + QLatin1String("<br/>") + , "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("<qt>Good signature from:<br /><b>%1</b><br />Key ID: %2<br /></qt>") + .arg(key.name).arg(vsig[9]); + } else { + result += tr("Good signature from: NAME <EMAIL>, Key ID: HEXID", + "<qt>Good signature from:<br /><b>%1 <%2></b><br />Key ID: %3<br /></qt>") + .arg(key.name).arg(key.email).arg(vsig[9]); + } + result += sigTimeMessage(vsig[2]); + + /* const KGpgKeyNode *node = model->findKeyNode(vsig[9]); if (node != NULL) { diff --git a/gpgcontext.h b/gpgcontext.h index d04034b..dc0edee 100644 --- a/gpgcontext.h +++ b/gpgcontext.h @@ -137,7 +137,7 @@ public: int textIsSigned(const QByteArray &text); static QString beautifyFingerprint(QString fingerprint); - static QString getReport(const QStringList &log); + QString getReport(const QStringList &log); signals: void keyDBChanged(); diff --git a/verifydetailsdialog.cpp b/verifydetailsdialog.cpp index a45521d..e603712 100644 --- a/verifydetailsdialog.cpp +++ b/verifydetailsdialog.cpp @@ -119,7 +119,7 @@ void VerifyDetailsDialog::slotVerifyDone(int result) { qDebug() << "vm: " << mess; }*/ - QString report = GpgME::GpgContext::getReport(verify->getMessages()); + QString report = mCtx->getReport(verify->getMessages()); mVboxLayout->addWidget(new QLabel(report)); diff --git a/verifykeydetailbox.cpp b/verifykeydetailbox.cpp index 521d122..103be21 100644 --- a/verifykeydetailbox.cpp +++ b/verifykeydetailbox.cpp @@ -27,7 +27,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext* ctx, this->mCtx = ctx; this->mKeyList = keyList; //this->fpr=signature->fpr; - qDebug() << "dbsig report: " << GpgME::GpgContext::getReport(signature.getMessages()); + //qDebug() << "dbsig report: " << GpgME::GpgContext::getReport(signature.getMessages()); QGridLayout *grid = new QGridLayout(); // TODO |