From 6ae10fc66ed3c35e98e49bac8bf6670f0a9e2d6b Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 28 Nov 2018 00:04:05 +0900 Subject: Adapted to new KPasswordEdit::password() signature. This relates to bug 2961. Signed-off-by: Michele Calgaro --- tdepasswd/passwddlg.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tdepasswd/passwddlg.cpp') diff --git a/tdepasswd/passwddlg.cpp b/tdepasswd/passwddlg.cpp index b1d5d1a16..f58a29996 100644 --- a/tdepasswd/passwddlg.cpp +++ b/tdepasswd/passwddlg.cpp @@ -26,7 +26,7 @@ TDEpasswd1Dialog::~TDEpasswd1Dialog() } -bool TDEpasswd1Dialog::checkPassword(const char *password) +bool TDEpasswd1Dialog::checkPassword(const TQString &password) { PasswdProcess proc(0); @@ -66,7 +66,7 @@ bool TDEpasswd1Dialog::checkPassword(const char *password) // static -int TDEpasswd1Dialog::getPassword(TQCString &password) +int TDEpasswd1Dialog::getPassword(TQString &password) { TDEpasswd1Dialog *dlg = new TDEpasswd1Dialog(); int res = dlg->exec(); @@ -78,7 +78,7 @@ int TDEpasswd1Dialog::getPassword(TQCString &password) -TDEpasswd2Dialog::TDEpasswd2Dialog(const char *oldpass, TQCString user) +TDEpasswd2Dialog::TDEpasswd2Dialog(const TQString &oldpass, const TQString &user) : KPasswordDialog(NewPassword, false, Help) { m_Pass = oldpass; @@ -88,7 +88,7 @@ TDEpasswd2Dialog::TDEpasswd2Dialog(const char *oldpass, TQCString user) if (m_User.isEmpty()) setPrompt(i18n("Please enter your new password:")); else - setPrompt(i18n("Please enter the new password for user %1:").arg(static_cast(m_User))); + setPrompt(i18n("Please enter the new password for user %1:").arg(m_User.utf8().data())); } @@ -97,11 +97,12 @@ TDEpasswd2Dialog::~TDEpasswd2Dialog() } -bool TDEpasswd2Dialog::checkPassword(const char *password) +bool TDEpasswd2Dialog::checkPassword(const TQString &password) { - PasswdProcess proc(m_User); + PasswdProcess proc(m_User.utf8()); + TQString edit_password = password; - if (strlen(password) > 8) + if (edit_password.length() > 8) { switch(KMessageBox::warningYesNoCancel(this, m_User.isEmpty() ? @@ -118,7 +119,7 @@ bool TDEpasswd2Dialog::checkPassword(const char *password) "truncatePassword")) { case KMessageBox::Yes : - const_cast(password)[8] = '\000'; + edit_password.truncate(8); break; case KMessageBox::No : break; @@ -126,7 +127,7 @@ bool TDEpasswd2Dialog::checkPassword(const char *password) } } - int ret = proc.exec(m_Pass, password); + int ret = proc.exec(m_Pass.utf8(), edit_password.utf8()); switch (ret) { case 0: -- cgit v1.2.1