diff options
| author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-07-26 03:41:06 +0200 |
|---|---|---|
| committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-07-26 03:41:06 +0200 |
| commit | 9bcd46bc010b64f2bff14463db3c4c0e82ff693b (patch) | |
| tree | 358bde0b5402723d16cdc43d162bef462ce1586e /gpgwin.cpp | |
| parent | added isCompletelySigned function (diff) | |
| download | gpg4usb-9bcd46bc010b64f2bff14463db3c4c0e82ff693b.tar.gz gpg4usb-9bcd46bc010b64f2bff14463db3c4c0e82ff693b.zip | |
changed bool iscompletlysigned to int issigned and added setverifylabel to verifynotification-class
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@505 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'gpgwin.cpp')
| -rw-r--r-- | gpgwin.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -708,15 +708,20 @@ void GpgWin::sign() cursor.endEditBlock(); } } -bool GpgWin::isCompletedlySigned(const QByteArray &text) { - +/* + * isSigned returns: + * - 0, if text isn't signed at all + * - 1, if text is partially signed + * - 2, if text is completly signed + */ +int GpgWin::isSigned(const QByteArray &text) { if (text.startsWith("-----BEGIN PGP SIGNED MESSAGE-----") && text.endsWith("-----END PGP SIGNATURE-----")) { - qDebug() << "totally signed"; - return true; - } else { - qDebug("partially signed"); - return false; + return 2; } + if (text.contains("-----BEGIN PGP SIGNED MESSAGE-----") && text.contains("-----END PGP SIGNATURE-----")) { + return 1; + } + return 0; } void GpgWin::verify() @@ -725,7 +730,7 @@ void GpgWin::verify() QByteArray text = edit->curTextPage()->toPlainText().toAscii(); // TODO: toUtf8() here? preventNoDataErr(&text); - isCompletedlySigned(text); + isSigned(text); gpgme_signature_t sign = mCtx->verify(text); @@ -734,10 +739,10 @@ void GpgWin::verify() } else { // TODO: should get verifynotification get the whole signature for analysizing VerifyNotification *vn = new VerifyNotification(); + vn->setVerifyLabel(QString("Verified")); edit->curPage()->showNotificationWidget(vn); } - // while (sign) { qDebug() << "sig summary: " << sign->summary; qDebug() << "sig fingerprint: " << sign->fpr; @@ -748,9 +753,7 @@ void GpgWin::verify() qDebug() << "kein passender Schlüssel gefunden. Vom Schlüsselserver importieren?"; } sign = sign->next; - } - } void GpgWin::importKeyDialog() |
