Use TQString for password instead of TQCString.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
v3.5.13-sru
Slávek Banko 3 years ago
parent 2d8f9f71ba
commit e9d8d887c5
Signed by: SlavekB
GPG Key ID: 608F5293A04BE668

@ -65,7 +65,7 @@ int main(int argc, char **argv)
TQString walletFolder = about.appName(); TQString walletFolder = about.appName();
TQString dialog = I18N_NOOP("Please enter password"); // Default dialog text TQString dialog = I18N_NOOP("Please enter password"); // Default dialog text
TQString keyFile; TQString keyFile;
TQCString password; TQString password;
// Parse commandline arguments // Parse commandline arguments
@ -86,14 +86,16 @@ int main(int argc, char **argv)
wallet->readPassword(keyFile, retrievedPass); wallet->readPassword(keyFile, retrievedPass);
if ( retrievedPass ) { if (!retrievedPass.isNull())
{
password = retrievedPass; password = retrievedPass;
} }
} }
// Password could not be retrieved from wallet. Open password dialog // 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 // create the password dialog, but only show "Enable Keep" button, if the wallet is opened
KPasswordDialog *kpd = new KPasswordDialog(KPasswordDialog::Password, wallet, 0); KPasswordDialog *kpd = new KPasswordDialog(KPasswordDialog::Password, wallet, 0);
kpd->setPrompt(dialog); 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 "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 ) ) { if ( !wallet->hasFolder( walletFolder ) ) {
wallet->createFolder(walletFolder); wallet->createFolder(walletFolder);
} }
@ -124,10 +127,13 @@ int main(int argc, char **argv)
} }
// Finally return the password if one has been entered // Finally return the password if one has been entered
if (password) { if(!password.isNull())
std::cout << password; {
return 0; std::cout << password.local8Bit();
} else { return 0;
return 1; }
else
{
return 1;
} }
} }

Loading…
Cancel
Save