diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-01-07 23:12:49 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-01-07 23:12:49 +0000 |
commit | bed1212dcb8de39657b43e31addd5b55ad41cc8a (patch) | |
tree | cdbb03b2a498a52a0998e114b95ed2e0efc6f1f7 /fileencryptiondialog.cpp | |
parent | show fingerprint instead of keyid in import detail dialog (diff) | |
download | gpg4usb-bed1212dcb8de39657b43e31addd5b55ad41cc8a.tar.gz gpg4usb-bed1212dcb8de39657b43e31addd5b55ad41cc8a.zip |
fixed bug in file cryption
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@728 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'fileencryptiondialog.cpp')
-rwxr-xr-x | fileencryptiondialog.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp index 82ce6a2..69ea7c9 100755 --- a/fileencryptiondialog.cpp +++ b/fileencryptiondialog.cpp @@ -25,10 +25,11 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QString iconP : QDialog(parent) { + mAction = action; mCtx = ctx; - if(action == Decrypt) { + if(mAction == Decrypt) { setWindowTitle(tr("Decrypt File")); - } else if (action == Encrypt) { + } else if (mAction == Encrypt) { setWindowTitle(tr("Encrypt File")); resize(500, 300); } else { @@ -118,7 +119,7 @@ void FileEncryptionDialog::selectInputFile() // try to find a matching output-filename, if not yet done if (infileName > 0 && outputFileEdit->text().size() == 0) { - if (radioEnc->isChecked()) { + if (mAction == Encrypt || (mAction == Both && radioEnc->isChecked())) { outputFileEdit->setText(infileName + ".asc"); } else { if (infileName.endsWith(".asc", Qt::CaseInsensitive)) { @@ -156,11 +157,12 @@ void FileEncryptionDialog::executeAction() QByteArray inBuffer = infile.readAll(); QByteArray *outBuffer = new QByteArray(); - if (radioEnc->isChecked()) { + + if ( mAction == Encrypt || (mAction == Both && radioEnc->isChecked())) { if (! mCtx->encrypt(mKeyList->getChecked(), inBuffer, outBuffer)) return; } - if (radioDec->isChecked()) { + if (mAction == Decrypt || (mAction == Both && radioDec->isChecked())) { if (! mCtx->decrypt(inBuffer, outBuffer)) return; } |