diff options
| author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-08-27 16:22:39 +0200 |
|---|---|---|
| committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-08-27 16:22:39 +0200 |
| commit | 1491bf832e06d0c1c3f6c9ced236c090263002d3 (patch) | |
| tree | 3b3cecda5a662c4bc214aa76200ede16e1455c22 /context.cpp | |
| parent | fix bug that crashes windows-build when encrypting twice (diff) | |
| download | gpg4usb-1491bf832e06d0c1c3f6c9ced236c090263002d3.tar.gz gpg4usb-1491bf832e06d0c1c3f6c9ced236c090263002d3.zip | |
implement remember password functionality
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@367 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'context.cpp')
| -rw-r--r-- | context.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/context.cpp b/context.cpp index 2630ee1..614a7ad 100644 --- a/context.cpp +++ b/context.cpp @@ -315,9 +315,11 @@ bool Context::decrypt(const QByteArray &inBuffer, QByteArray *outBuffer) if (err != GPG_ERR_NO_ERROR && err != GPG_ERR_CANCELED) { QMessageBox::critical(0, "Error decrypting:", gpgme_strerror(err)); } + //if (err != GPG_ERR_NO_ERROR) - // always clear password cache. TODO: implement passwort save - clearCache(); + if (! settings.value("general/rememberPassword").toBool()) { + clearPasswordCache(); + } if (in) { gpgme_data_release(in); @@ -382,7 +384,7 @@ gpgme_error_t Context::passphrase(const char *uid_hint, if (last_was_bad) { s += "<i>Wrong password.</i><br><br>\n\n"; - clearCache(); + clearPasswordCache(); } /** if uid provided */ @@ -429,7 +431,7 @@ gpgme_error_t Context::passphrase(const char *uid_hint, } /** also from kgpgme.cpp, seems to clear password from mem */ -void Context::clearCache() +void Context::clearPasswordCache() { if (mPasswordCache.size() > 0) { mPasswordCache.fill('\0'); |
