diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-07-11 01:21:35 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-07-11 01:21:35 +0000 |
commit | c672e2b17f14c8df54cfe9b43de44de1e445684a (patch) | |
tree | c4cdfcc5826ddb7dc403469d2b08dedb64e67d3a | |
parent | added Qlabel at the buttom of textedit for verify (diff) | |
download | gpg4usb-c672e2b17f14c8df54cfe9b43de44de1e445684a.tar.gz gpg4usb-c672e2b17f14c8df54cfe9b43de44de1e445684a.zip |
added preventnodataerr for verifying
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@492 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | gpgwin.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -631,6 +631,10 @@ void GpgWin::preventNoDataErr(QByteArray *in) if (block_start > 0 && in->at(block_start - 1) != '\n') { in->insert(block_start, '\n'); } + block_start = in->indexOf("-----BEGIN PGP SIGNED MESSAGE-----"); + if (block_start > 0 && in->at(block_start - 1) != '\n') { + in->insert(block_start, '\n'); + } } void GpgWin::importKeyFromEdit() @@ -694,7 +698,10 @@ void GpgWin::sign() void GpgWin::verify() { - int error = mCtx->verify(edit->curTextPage()->toPlainText().toUtf8()); + QByteArray text = edit->curTextPage()->toPlainText().toAscii(); // TODO: toUtf8() here? + preventNoDataErr(&text); + + int error = mCtx->verify(text); if (error == 0) { edit->curPage()->showVerifyLabel(true); } else { |