aboutsummaryrefslogtreecommitdiffstats
path: root/gpgwin.cpp
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-01-30 02:20:19 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-01-30 02:20:19 +0000
commit2c5a0b4ec6ecd013a4e9105879745ab7cb859ef8 (patch)
treec71e4107c06f6871cba6f32f6de83b02b7b68e78 /gpgwin.cpp
parentrestructured code of about dialog (diff)
downloadgpg4usb-2c5a0b4ec6ecd013a4e9105879745ab7cb859ef8.tar.gz
gpg4usb-2c5a0b4ec6ecd013a4e9105879745ab7cb859ef8.zip
don't replace text if decryption failed, e.g. there was no text to decrypt
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@459 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'gpgwin.cpp')
-rw-r--r--gpgwin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/gpgwin.cpp b/gpgwin.cpp
index 0771e52..45247b2 100644
--- a/gpgwin.cpp
+++ b/gpgwin.cpp
@@ -503,7 +503,12 @@ void GpgWin::decrypt()
QByteArray *decrypted = new QByteArray();
QByteArray text = edit->curTextPage()->toPlainText().toAscii(); // TODO: toUtf8() here?
preventNoDataErr(&text);
- mCtx->decrypt(text, decrypted);
+
+ // try decrypt, if fail do nothing, especially don't replace text
+ if(!mCtx->decrypt(text, decrypted)) {
+ return;
+ }
+ ;
/**
* 1) is it mime (content-type:)
* 2) parse header