diff options
author | Michele Calgaro <[email protected]> | 2018-11-27 14:55:23 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2018-11-27 14:55:23 +0900 |
commit | 6ec26d859be239e6db1bb392140db76227a56522 (patch) | |
tree | 1cae6e9ff2c6537c9454113f54a20b123f3921d1 /tdeui/kpassdlg.cpp | |
parent | 82afa07a430c43bc122c7325dc67fb9f3ad6216a (diff) | |
download | tdelibs-6ec26d859be239e6db1bb392140db76227a56522.tar.gz tdelibs-6ec26d859be239e6db1bb392140db76227a56522.zip |
KPasswordEdit::password() now returns a TQString instead of a const char *. This relates to bug 2961.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'tdeui/kpassdlg.cpp')
-rw-r--r-- | tdeui/kpassdlg.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tdeui/kpassdlg.cpp b/tdeui/kpassdlg.cpp index 87df72f60..7ada9dc8e 100644 --- a/tdeui/kpassdlg.cpp +++ b/tdeui/kpassdlg.cpp @@ -138,8 +138,8 @@ KPasswordEdit::~KPasswordEdit() { } -const char *KPasswordEdit::password() const { - return text().ascii(); +TQString KPasswordEdit::password() const { + return text(); } void KPasswordEdit::erase() @@ -404,7 +404,7 @@ void KPasswordDialog::erase() void KPasswordDialog::slotOk() { if (m_Type == NewPassword) { - if (strcmp(m_pEdit->password(), m_pEdit2->password())) { + if (m_pEdit->password() != m_pEdit2->password()) { KMessageBox::sorry(this, i18n("You entered two different " "passwords. Please try again.")); erase(); @@ -459,8 +459,7 @@ void KPasswordDialog::slotLayout() } -// static . antlarr: KDE 4: Make it const TQString & prompt -int KPasswordDialog::getPassword(TQCString &password, TQString prompt, +int KPasswordDialog::getPassword(TQString &password, TQString prompt, int *keep) { const bool enableKeep = (keep && *keep); @@ -477,7 +476,7 @@ int KPasswordDialog::getPassword(TQCString &password, TQString prompt, // static . antlarr: KDE 4: Make it const TQString & prompt -int KPasswordDialog::getNewPassword(TQCString &password, TQString prompt) +int KPasswordDialog::getNewPassword(TQString &password, TQString prompt) { KPasswordDialog* const dlg = new KPasswordDialog(NewPassword, prompt); const int ret = dlg->exec(); @@ -502,8 +501,8 @@ void KPasswordDialog::virtual_hook( int id, void* data ) void KPasswordDialog::enableOkBtn() { if (m_Type == NewPassword) { - const bool match = strcmp(m_pEdit->password(), m_pEdit2->password()) == 0 - && (d->allowEmptyPasswords || m_pEdit->password()[0]); + const bool match = (m_pEdit->password() == m_pEdit2->password()) + && (d->allowEmptyPasswords || !m_pEdit->password().isEmpty()); const TQString pass(m_pEdit->password()); @@ -515,7 +514,7 @@ void KPasswordDialog::enableOkBtn() enableButtonOK( match ); } - if ( match && d->allowEmptyPasswords && m_pEdit->password()[0] == 0 ) { + if ( match && d->allowEmptyPasswords && m_pEdit->password().isEmpty() ) { d->m_MatchLabel->setText( i18n("Password is empty") ); } else { if ((int) pass.length() < minPasswordLength) { |