diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-08-29 14:22:30 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-08-29 14:22:30 +0000 |
commit | ee7ae988c6d4de11fb25c3fd4be05b858b5eddb3 (patch) | |
tree | cee76713c8098cb60f90bea6cf721c4f991cf7c6 /context.cpp | |
parent | try to fix decrpyt-cancel on windows (diff) | |
download | gpg4usb-ee7ae988c6d4de11fb25c3fd4be05b858b5eddb3.tar.gz gpg4usb-ee7ae988c6d4de11fb25c3fd4be05b858b5eddb3.zip |
reverted last change
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@374 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'context.cpp')
-rw-r--r-- | context.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/context.cpp b/context.cpp index d31f868..bb26ee9 100644 --- a/context.cpp +++ b/context.cpp @@ -377,7 +377,7 @@ gpgme_error_t Context::passphrase(const char *uid_hint, const char * /*passphrase_info*/, int last_was_bad, int fd) { - gpgme_error_t returnValue; // = GPG_ERR_CANCELED; + gpgme_error_t returnValue = GPG_ERR_CANCELED; QString s; QString gpg_hint = uid_hint; bool result; @@ -394,23 +394,17 @@ gpgme_error_t Context::passphrase(const char *uid_hint, s += "<b>Enter Password for</b><br>\n" + gpg_hint + "\n"; } - // password saved? if yes, do'nt ask and take from buffer if (mPasswordCache.isEmpty()) { QString password = QInputDialog::getText(0, "Enter Password", s, QLineEdit::Password, "", &result, Qt::Window); - // user canceld password entry? - if (result) { - mPasswordCache = password.toAscii(); - } else { - return GPG_ERR_CANCELED; - } - } //else { - // result = true; - //} + if (result) mPasswordCache = password.toAscii(); + } else { + result = true; + } - //if (result) { + if (result) { #ifndef _WIN32 if (write(fd, mPasswordCache.data(), mPasswordCache.length()) == -1) { @@ -421,19 +415,18 @@ gpgme_error_t Context::passphrase(const char *uid_hint, WriteFile((HANDLE) fd, mPasswordCache.data(), mPasswordCache.length(), &written, 0); #endif - returnValue = GPG_ERR_NO_ERROR; + returnValue = 0; + } #ifndef _WIN32 if (write(fd, "\n", 1) == -1) { qDebug() << "something is terribly broken"; } #else - DWORD written; + // DWORD written; WriteFile((HANDLE) fd, "\n", 1, &written, 0); #endif - //} - return returnValue; } |