summaryrefslogtreecommitdiffstats
path: root/tdeio/misc/tdewalletd/tdewalletd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdeio/misc/tdewalletd/tdewalletd.cpp')
-rw-r--r--tdeio/misc/tdewalletd/tdewalletd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tdeio/misc/tdewalletd/tdewalletd.cpp b/tdeio/misc/tdewalletd/tdewalletd.cpp
index 5d73df4e6..97e942c3a 100644
--- a/tdeio/misc/tdewalletd/tdewalletd.cpp
+++ b/tdeio/misc/tdewalletd/tdewalletd.cpp
@@ -471,13 +471,13 @@ int TDEWalletD::internalOpen(const TQCString& appid, const TQString& wallet, boo
kpd->setAllowEmptyPasswords(true);
}
- const char *p = 0L;
+ TQCString p;
while (!b->isOpen()) {
assert(kpd); // kpd can't be null if isOpen() is false
setupDialog( kpd, w, appid, modal );
if (kpd->exec() == KDialog::Accepted) {
- p = kpd->password();
- int rc = b->open(TQByteArray().duplicate(p, strlen(p)));
+ p = kpd->password().utf8();
+ int rc = b->open(TQByteArray().duplicate(p));
if (!b->isOpen()) {
kpd->setPrompt(i18n("<qt>Error opening the wallet '<b>%1</b>'. Please try again.<br>(Error code %2: %3)").arg(TQStyleSheet::escape(wallet)).arg(rc).arg(TDEWallet::Backend::openRCToString(rc)));
kpd->clearPassword();
@@ -487,7 +487,7 @@ int TDEWalletD::internalOpen(const TQCString& appid, const TQString& wallet, boo
}
}
- if (!emptyPass && (!p || !b->isOpen())) {
+ if (!emptyPass && (p.isEmpty() || !b->isOpen())) {
delete b;
delete kpd;
return -1;
@@ -662,11 +662,11 @@ void TDEWalletD::doTransactionChangePassword(const TQCString& appid, const TQStr
kpd->setAllowEmptyPasswords(true);
setupDialog( kpd, wId, appid, false );
if (kpd->exec() == KDialog::Accepted) {
- const char *p = kpd->password();
- if (p) {
+ TQCString p = kpd->password().utf8();
+ if (!p.isEmpty()) {
_passwords[wallet] = p;
TQByteArray pa;
- pa.duplicate(p, strlen(p));
+ pa.duplicate(p);
int rc = w->close(pa);
if (rc < 0) {
KMessageBox::sorryWId(wId, i18n("Error re-encrypting the wallet. Password was not changed."), i18n("TDE Wallet Service"));