diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-10-11 20:34:55 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-10-11 20:34:55 +0000 |
commit | 5af560a0ef23b5a1d134f65e135e5c7f4bc1a84c (patch) | |
tree | 748f719a627d5e2a0dea167b4c25758e47f73b0e /gpgwin.cpp | |
parent | moved preventnodataerr to context.cpp, added refresh slots for verify (diff) | |
download | gpg4usb-5af560a0ef23b5a1d134f65e135e5c7f4bc1a84c.tar.gz gpg4usb-5af560a0ef23b5a1d134f65e135e5c7f4bc1a84c.zip |
moved textissigned to context
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@545 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'gpgwin.cpp')
-rw-r--r-- | gpgwin.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
@@ -634,29 +634,13 @@ void GpgWin::decrypt() edit->fillTextEditWithText(QString::fromUtf8(*decrypted)); } -/* - * 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.trimmed().startsWith("-----BEGIN PGP SIGNED MESSAGE-----") && text.trimmed().endsWith("-----END PGP SIGNATURE-----")) { - return 2; - } - if (text.contains("-----BEGIN PGP SIGNED MESSAGE-----") && text.contains("-----END PGP SIGNATURE-----")) { - return 1; - } - return 0; -} - void GpgWin::verify() { QDateTime timestamp; verify_label_status verifyStatus=VERIFY_ERROR_OK; QByteArray text = edit->curTextPage()->toPlainText().toAscii(); // TODO: toUtf8() here? mCtx->preventNoDataErr(&text); - int textIsSigned = isSigned(text); + int textIsSigned = mCtx->textIsSigned(text); gpgme_signature_t sign = mCtx->verify(text); edit->curPage()->closeNoteByClass("verifyNotification"); |