From 5af560a0ef23b5a1d134f65e135e5c7f4bc1a84c Mon Sep 17 00:00:00 2001 From: nils Date: Tue, 11 Oct 2011 20:34:55 +0000 Subject: moved textissigned to context git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@545 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgwin.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'gpgwin.cpp') diff --git a/gpgwin.cpp b/gpgwin.cpp index d0f2ba4..66b0220 100644 --- a/gpgwin.cpp +++ b/gpgwin.cpp @@ -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"); -- cgit