Adapted to new KPasswordEdit::password() signature. This relates to bug 2961.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/4/head
Michele Calgaro 6 years ago
parent ca937b0c3e
commit 53fe3bf43a
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -1170,7 +1170,7 @@ void KcmSambaConf::addSambaUserBtnClicked()
{ {
SambaUser user( item->text(0), item->text(1).toInt() ); SambaUser user( item->text(0), item->text(1).toInt() );
TQCString password; TQString password;
int passResult = KPasswordDialog::getNewPassword(password, int passResult = KPasswordDialog::getNewPassword(password,
i18n("<qt>Please enter a password for the user <b>%1</b></qt>").arg(user.name)); i18n("<qt>Please enter a password for the user <b>%1</b></qt>").arg(user.name));
if (passResult != KPasswordDialog::Accepted) { if (passResult != KPasswordDialog::Accepted) {
@ -1233,7 +1233,7 @@ void KcmSambaConf::sambaUserPasswordBtnClicked()
{ {
SambaUser user( item->text(0), item->text(1).toInt() ); SambaUser user( item->text(0), item->text(1).toInt() );
TQCString password; TQString password;
int passResult = KPasswordDialog::getNewPassword(password, int passResult = KPasswordDialog::getNewPassword(password,
i18n("Please enter a password for the user %1").arg(user.name)); i18n("Please enter a password for the user %1").arg(user.name));
if (passResult != KPasswordDialog::Accepted) if (passResult != KPasswordDialog::Accepted)

@ -206,7 +206,7 @@ public:
void slotOkPressed() void slotOkPressed()
{ {
TQString result = TQString::fromLocal8Bit( mView->m_password->password() ); TQString result = mView->m_password->password();
if ( mView->m_save_passwd->isChecked() ) if ( mView->m_save_passwd->isChecked() )
mPassword.set( result ); mPassword.set( result );

@ -108,7 +108,7 @@ bool Kopete::UI::PasswordWidget::validate()
TQString Kopete::UI::PasswordWidget::password() const TQString Kopete::UI::PasswordWidget::password() const
{ {
return TQString::fromLocal8Bit( mPassword->password() ); return mPassword->password();
} }
bool Kopete::UI::PasswordWidget::remember() const bool Kopete::UI::PasswordWidget::remember() const

@ -117,12 +117,12 @@ CryptographyPlugin* CryptographyPlugin::plugin()
CryptographyPlugin* CryptographyPlugin::pluginStatic_ = 0L; CryptographyPlugin* CryptographyPlugin::pluginStatic_ = 0L;
TQCString CryptographyPlugin::cachedPass() TQString CryptographyPlugin::cachedPass()
{ {
return pluginStatic_->m_cachedPass; return pluginStatic_->m_cachedPass;
} }
void CryptographyPlugin::setCachedPass(const TQCString& p) void CryptographyPlugin::setCachedPass(const TQString& p)
{ {
if(pluginStatic_->mCacheMode==Never) if(pluginStatic_->mCacheMode==Never)
return; return;
@ -308,7 +308,7 @@ void CryptographyPlugin::slotSelectContactKey()
void CryptographyPlugin::slotForgetCachedPass() void CryptographyPlugin::slotForgetCachedPass()
{ {
m_cachedPass=TQCString(); m_cachedPass=TQString();
m_cachedPass_timer->stop(); m_cachedPass_timer->stop();
} }

@ -51,8 +51,8 @@ public:
}; };
static CryptographyPlugin *plugin(); static CryptographyPlugin *plugin();
static TQCString cachedPass(); static TQString cachedPass();
static void setCachedPass(const TQCString &pass); static void setCachedPass(const TQString &pass);
static bool passphraseHandling(); static bool passphraseHandling();
static const TQRegExp isHTML; static const TQRegExp isHTML;
@ -75,7 +75,7 @@ private slots:
private: private:
static CryptographyPlugin* pluginStatic_; static CryptographyPlugin* pluginStatic_;
Kopete::SimpleMessageHandlerFactory *m_inboundHandler; Kopete::SimpleMessageHandlerFactory *m_inboundHandler;
TQCString m_cachedPass; TQString m_cachedPass;
TQTimer *m_cachedPass_timer; TQTimer *m_cachedPass_timer;
//cache messages for showing //cache messages for showing

@ -85,7 +85,7 @@ TQString KgpgInterface::KgpgDecryptText(TQString text,TQString userID)
char buffer[200]; char buffer[200];
int counter=0,ppass[2]; int counter=0,ppass[2];
TQCString password = CryptographyPlugin::cachedPass(); TQString password = CryptographyPlugin::cachedPass();
bool passphraseHandling=CryptographyPlugin::passphraseHandling(); bool passphraseHandling=CryptographyPlugin::passphraseHandling();
while ((counter<3) && (encResult.isEmpty())) while ((counter<3) && (encResult.isEmpty()))
@ -111,7 +111,8 @@ TQString KgpgInterface::KgpgDecryptText(TQString text,TQString userID)
{ {
pipe(ppass); pipe(ppass);
pass = fdopen(ppass[1], "w"); pass = fdopen(ppass[1], "w");
fwrite(password, sizeof(char), strlen(password), pass); TQCString pass2 = password.local8Bit();
fwrite(pass2, sizeof(char), pass2.length(), pass);
// fwrite("\n", sizeof(char), 1, pass); // fwrite("\n", sizeof(char), 1, pass);
fclose(pass); fclose(pass);
} }
@ -129,7 +130,7 @@ TQString KgpgInterface::KgpgDecryptText(TQString text,TQString userID)
encResult += TQString::fromUtf8(buffer); encResult += TQString::fromUtf8(buffer);
pclose(fp); pclose(fp);
password = TQCString(); password.fill(' ');
} }
if( !encResult.isEmpty() ) if( !encResult.isEmpty() )

@ -1515,7 +1515,7 @@ void JabberAccount::slotGroupChatError (const XMPP::Jid &jid, int error, const T
{ {
case JabberClient::InvalidPasswordForMUC: case JabberClient::InvalidPasswordForMUC:
{ {
TQCString password; TQString password;
int result = KPasswordDialog::getPassword(password, i18n("A password is required to join the room %1.").arg(jid.node())); int result = KPasswordDialog::getPassword(password, i18n("A password is required to join the room %1.").arg(jid.node()));
if (result == KPasswordDialog::Accepted) if (result == KPasswordDialog::Accepted)
m_jabberClient->joinGroupChat(jid.domain(), jid.node(), jid.resource(), password); m_jabberClient->joinGroupChat(jid.domain(), jid.node(), jid.resource(), password);

@ -49,7 +49,7 @@ DlgJabberChangePassword::~DlgJabberChangePassword()
void DlgJabberChangePassword::slotOk () void DlgJabberChangePassword::slotOk ()
{ {
if ( !strlen ( m_mainWidget->peCurrentPassword->password () ) if ( m_mainWidget->peCurrentPassword->password().length() == 0
|| ( m_account->password().cachedValue () != m_mainWidget->peCurrentPassword->password () ) ) || ( m_account->password().cachedValue () != m_mainWidget->peCurrentPassword->password () ) )
{ {
KMessageBox::queuedMessageBox ( this, KMessageBox::Sorry, KMessageBox::queuedMessageBox ( this, KMessageBox::Sorry,
@ -58,7 +58,7 @@ void DlgJabberChangePassword::slotOk ()
return; return;
} }
if ( strcmp ( m_mainWidget->peNewPassword1->password (), m_mainWidget->peNewPassword2->password () ) != 0 ) if ( m_mainWidget->peNewPassword1->password() != m_mainWidget->peNewPassword2->password() )
{ {
KMessageBox::queuedMessageBox ( this, KMessageBox::Sorry, KMessageBox::queuedMessageBox ( this, KMessageBox::Sorry,
i18n ( "Your new passwords do not match. Please enter them again." ), i18n ( "Your new passwords do not match. Please enter them again." ),
@ -66,7 +66,7 @@ void DlgJabberChangePassword::slotOk ()
return; return;
} }
if ( !strlen ( m_mainWidget->peNewPassword1->password () ) ) if ( !m_mainWidget->peNewPassword1->password().length() )
{ {
KMessageBox::queuedMessageBox ( this, KMessageBox::Sorry, KMessageBox::queuedMessageBox ( this, KMessageBox::Sorry,
i18n ( "For security reasons, you are not allowed to set an empty password." ), i18n ( "For security reasons, you are not allowed to set an empty password." ),

@ -146,8 +146,8 @@ void JabberRegisterAccount::validateData ()
} }
if ( valid && if ( valid &&
( TQString::fromLatin1 ( mMainWidget->lePassword->password () ).isEmpty () || ( mMainWidget->lePassword->password().isEmpty() ||
TQString::fromLatin1 ( mMainWidget->lePasswordVerify->password () ).isEmpty () ) ) mMainWidget->lePasswordVerify->password().isEmpty() ) )
{ {
mMainWidget->lblStatusMessage->setText ( i18n ( "Please enter the same password twice." ) ); mMainWidget->lblStatusMessage->setText ( i18n ( "Please enter the same password twice." ) );
valid = false; valid = false;
@ -155,8 +155,7 @@ void JabberRegisterAccount::validateData ()
} }
if ( valid && if ( valid &&
( TQString::fromLatin1 ( mMainWidget->lePassword->password () ) != ( mMainWidget->lePassword->password() != mMainWidget->lePasswordVerify->password() ) )
TQString::fromLatin1 ( mMainWidget->lePasswordVerify->password () ) ) )
{ {
mMainWidget->lblStatusMessage->setText ( i18n ( "Password entries do not match." ) ); mMainWidget->lblStatusMessage->setText ( i18n ( "Password entries do not match." ) );
valid = false; valid = false;

@ -275,7 +275,7 @@ bool KRdpView::start()
if ( m_password.isEmpty() ) { if ( m_password.isEmpty() ) {
//There must not be an existing entry. Let's make one. //There must not be an existing entry. Let's make one.
TQCString newPassword; TQString newPassword;
if (KPasswordDialog::getPassword(newPassword, i18n("Please enter the password.")) == KPasswordDialog::Accepted) { if (KPasswordDialog::getPassword(newPassword, i18n("Please enter the password.")) == KPasswordDialog::Accepted) {
m_password = newPassword; m_password = newPassword;
wallet->writePassword(m_host, m_password); wallet->writePassword(m_host, m_password);

@ -59,7 +59,7 @@ static KVncView *kvncview;
//Passwords and TDEWallet data //Passwords and TDEWallet data
extern TDEWallet::Wallet *wallet; extern TDEWallet::Wallet *wallet;
bool useTDEWallet = false; bool useTDEWallet = false;
static TQCString password; static TQString password;
static TQMutex passwordLock; static TQMutex passwordLock;
static TQWaitCondition passwordWaiter; static TQWaitCondition passwordWaiter;
@ -88,7 +88,7 @@ KVncView::KVncView(TQWidget *parent,
m_cursorState(dotCursorState) m_cursorState(dotCursorState)
{ {
kvncview = this; kvncview = this;
password = _password.latin1(); password = _password;
dpy = tqt_xdisplay(); dpy = tqt_xdisplay();
setFixedSize(16,16); setFixedSize(16,16);
setFocusPolicy(TQ_StrongFocus); setFocusPolicy(TQ_StrongFocus);
@ -417,7 +417,7 @@ void KVncView::customEvent(TQCustomEvent *e)
emit showingPasswordDialog(true); emit showingPasswordDialog(true);
if (KPasswordDialog::getPassword(password, i18n("Access to the system requires a password.")) != KPasswordDialog::Accepted) if (KPasswordDialog::getPassword(password, i18n("Access to the system requires a password.")) != KPasswordDialog::Accepted)
password = TQCString(); password = TQString();
emit showingPasswordDialog(false); emit showingPasswordDialog(false);
@ -450,7 +450,7 @@ void KVncView::customEvent(TQCustomEvent *e)
wallet->setFolder(krdc_folder); wallet->setFolder(krdc_folder);
TQString newPass; TQString newPass;
if ( wallet->hasEntry(kvncview->host()) && !wallet->readPassword(kvncview->host(), newPass) ) { if ( wallet->hasEntry(kvncview->host()) && !wallet->readPassword(kvncview->host(), newPass) ) {
password=newPass.latin1(); password=newPass;
} }
} }
} }
@ -792,7 +792,7 @@ int getPassword(char * &passwd) {
//Process the password if we got it, clear it if we didn't //Process the password if we got it, clear it if we didn't
if (retV) { if (retV) {
passwd = strdup((const char*)password); passwd = strdup(password.utf8());
} }
//Pack up and go home //Pack up and go home

Loading…
Cancel
Save