summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-08-26 03:24:32 +0200
committerSlávek Banko <slavek.banko@axis.cz>2021-08-26 14:18:18 +0200
commite9d8d887c5ec276150871f1bff2509cc97e9eda7 (patch)
tree8d475253007499b3676b92c00dd4873100d9ffd4
parent2d8f9f71ba8a1dc140d97b43c66f21a78794f53b (diff)
downloadtdesshaskpass-e9d8d887c5ec276150871f1bff2509cc97e9eda7.tar.gz
tdesshaskpass-e9d8d887c5ec276150871f1bff2509cc97e9eda7.zip
Use TQString for password instead of TQCString.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--src/ksshaskpass.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/ksshaskpass.cpp b/src/ksshaskpass.cpp
index 3151e2b..bad94c1 100644
--- a/src/ksshaskpass.cpp
+++ b/src/ksshaskpass.cpp
@@ -65,7 +65,7 @@ int main(int argc, char **argv)
TQString walletFolder = about.appName();
TQString dialog = I18N_NOOP("Please enter password"); // Default dialog text
TQString keyFile;
- TQCString password;
+ TQString password;
// Parse commandline arguments
@@ -86,14 +86,16 @@ int main(int argc, char **argv)
wallet->readPassword(keyFile, retrievedPass);
- if ( retrievedPass ) {
+ if (!retrievedPass.isNull())
+ {
password = retrievedPass;
}
}
// Password could not be retrieved from wallet. Open password dialog
- if ( !password ) {
+ if (password.isNull())
+ {
// create the password dialog, but only show "Enable Keep" button, if the wallet is opened
KPasswordDialog *kpd = new KPasswordDialog(KPasswordDialog::Password, wallet, 0);
kpd->setPrompt(dialog);
@@ -107,7 +109,8 @@ int main(int argc, char **argv)
}
// If "Enable Keep" is enabled, open/create a folder in KWallet and store the password.
- if ( password && wallet && kpd->keep() ) {
+ if (!password.isNull() && wallet && kpd->keep())
+ {
if ( !wallet->hasFolder( walletFolder ) ) {
wallet->createFolder(walletFolder);
}
@@ -124,10 +127,13 @@ int main(int argc, char **argv)
}
// Finally return the password if one has been entered
- if (password) {
- std::cout << password;
- return 0;
- } else {
- return 1;
+ if(!password.isNull())
+ {
+ std::cout << password.local8Bit();
+ return 0;
+ }
+ else
+ {
+ return 1;
}
}