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 1d93eb1e7a
commit 580ffcad38
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -1,6 +1,6 @@
/* /*
ark -- archiver for the KDE project ark -- archiver for the TDE project
Copyright (C) Copyright (C)
@ -152,7 +152,7 @@ class Arch : public TQObject
const TQString &filename, const TQString &filename,
const TQString &openAsMimeType = TQString() ); const TQString &openAsMimeType = TQString() );
TQString password() { return m_password; } TQString password() { return m_password; }
void setPassword(const TQString & pw) { m_password = pw.local8Bit(); } void setPassword(const TQString & pw) { m_password = pw; }
virtual void createPassword() {} virtual void createPassword() {}
protected slots: protected slots:
@ -206,7 +206,7 @@ class Arch : public TQObject
TQStringList *m_fileList; TQStringList *m_fileList;
TQString m_destDir; TQString m_destDir;
bool m_viewFriendly; bool m_viewFriendly;
TQCString m_password; TQString m_password;
}; };
// Columns // Columns

@ -108,7 +108,7 @@ void ArjArch::addFile( const TQStringList & urls )
*kp << "-r"; *kp << "-r";
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-g"+m_password; *kp << "-g"+m_password.local8Bit();
*kp << m_filename; *kp << m_filename;
@ -221,7 +221,7 @@ void ArjArch::unarchFileInternal()
*kp << "x"; *kp << "x";
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-g" + m_password; *kp << "-g" + m_password.local8Bit();
if ( ArkSettings::extractOverwrite() ) if ( ArkSettings::extractOverwrite() )
*kp << "-jyo"; *kp << "-jyo";
@ -306,7 +306,7 @@ void ArjArch::test()
*kp << m_unarchiver_program << "t"; *kp << m_unarchiver_program << "t";
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-g" + m_password; *kp << "-g" + m_password.local8Bit();
*kp << m_filename; *kp << m_filename;

@ -205,7 +205,7 @@ void RarArch::open()
*kp << m_unarchiver_program << "v" << "-c-"; *kp << m_unarchiver_program << "v" << "-c-";
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-p" + m_password; *kp << "-p" + m_password.local8Bit();
else else
*kp << "-p-"; *kp << "-p-";
@ -283,7 +283,7 @@ void RarArch::addFile( const TQStringList & urls )
*kp << "-r"; *kp << "-r";
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-p"+m_password; *kp << "-p"+m_password.local8Bit();
*kp << m_filename; *kp << m_filename;
@ -326,7 +326,7 @@ void RarArch::unarchFileInternal()
*kp << m_unarchiver_program << "x"; *kp << m_unarchiver_program << "x";
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-p" + m_password; *kp << "-p" + m_password.local8Bit();
else else
*kp << "-p-"; *kp << "-p-";
@ -414,7 +414,7 @@ void RarArch::test()
*kp << m_unarchiver_program << "t"; *kp << m_unarchiver_program << "t";
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-p" + m_password; *kp << "-p" + m_password.local8Bit();
*kp << m_filename; *kp << m_filename;

@ -136,7 +136,7 @@ void SevenZipArch::addFile( const TQStringList & urls )
*kp << m_archiver_program << "a" ; *kp << m_archiver_program << "a" ;
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-p" + m_password; *kp << "-p" + m_password.local8Bit();
KURL url( urls.first() ); KURL url( urls.first() );
TQDir::setCurrent( url.directory() ); TQDir::setCurrent( url.directory() );
@ -232,7 +232,7 @@ void SevenZipArch::unarchFileInternal( )
*kp << "-y"; *kp << "-y";
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-p" + m_password; *kp << "-p" + m_password.local8Bit();
*kp << m_filename; *kp << m_filename;
@ -401,7 +401,7 @@ void SevenZipArch::test()
*kp << m_unarchiver_program << "t"; *kp << m_unarchiver_program << "t";
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-p" + m_password; *kp << "-p" + m_password.local8Bit();
*kp << m_filename; *kp << m_filename;

@ -108,7 +108,6 @@ class TarArch : public Arch
void setHeaders(); void setHeaders();
void processDir( const KTarDirectory *tardir, const TQString & root ); void processDir( const KTarDirectory *tardir, const TQString & root );
void deleteOldFiles( const TQStringList &list, bool bAddOnlyNew ); void deleteOldFiles( const TQStringList &list, bool bAddOnlyNew );
TQString getEntry( const TQString & filename );
private: // data private: // data
// if the tar is compressed, this is the temporary uncompressed tar. // if the tar is compressed, this is the temporary uncompressed tar.

@ -144,7 +144,7 @@ void ZipArch::addFile( const TQStringList &urls )
*kp << m_archiver_program; *kp << m_archiver_program;
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-P" << m_password; *kp << "-P" << m_password.local8Bit();
if ( ArkSettings::rarRecurseSubdirs() ) if ( ArkSettings::rarRecurseSubdirs() )
*kp << "-r"; *kp << "-r";
@ -202,7 +202,7 @@ void ZipArch::unarchFileInternal()
*kp << m_unarchiver_program; *kp << m_unarchiver_program;
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-P" << m_password; *kp << "-P" << m_password.local8Bit();
if ( ArkSettings::extractJunkPaths() && !m_viewFriendly ) if ( ArkSettings::extractJunkPaths() && !m_viewFriendly )
*kp << "-j" ; *kp << "-j" ;
@ -292,7 +292,7 @@ void ZipArch::test()
*kp << m_unarchiver_program << "-t"; *kp << m_unarchiver_program << "-t";
if ( !m_password.isEmpty() ) if ( !m_password.isEmpty() )
*kp << "-P" << m_password; *kp << "-P" << m_password.local8Bit();
*kp << m_filename; *kp << m_filename;

@ -149,7 +149,7 @@ void KgpgInterface::readencprocess(KProcIO *p)
if (required.find("openfile.overwrite.okay")!=-1) if (required.find("openfile.overwrite.okay")!=-1)
p->writeStdin(TQString("Yes")); p->writeStdin(TQString("Yes"));
else if ((required.find("passphrase.enter")!=-1)) { else if ((required.find("passphrase.enter")!=-1)) {
TQCString passphrase; TQString passphrase;
int code=KPasswordDialog::getNewPassword(passphrase,i18n("Enter passphrase for your file (symmetrical encryption):")); int code=KPasswordDialog::getNewPassword(passphrase,i18n("Enter passphrase for your file (symmetrical encryption):"));
if (code!=TQDialog::Accepted) { if (code!=TQDialog::Accepted) {
p->deleteLater(); p->deleteLater();
@ -226,7 +226,7 @@ void KgpgInterface::readdecprocess(KProcIO *p)
if (userIDs.isEmpty()) if (userIDs.isEmpty())
userIDs=i18n("[No user id found]"); userIDs=i18n("[No user id found]");
userIDs.replace(TQRegExp("<"),"&lt;"); userIDs.replace(TQRegExp("<"),"&lt;");
TQCString passphrase; TQString passphrase;
TQString passdlgmessage; TQString passdlgmessage;
if (anonymous) if (anonymous)
passdlgmessage=i18n("<b>No user id found</b>. Trying all secret keys.<br>"); passdlgmessage=i18n("<b>No user id found</b>. Trying all secret keys.<br>");
@ -313,7 +313,7 @@ void KgpgInterface::txtreadencprocess(KProcIO *p)
else else
if ((required.find("passphrase.enter")!=-1)) if ((required.find("passphrase.enter")!=-1))
{ {
TQCString passphrase; TQString passphrase;
TQString passdlgmessage=i18n("Enter passphrase (symmetrical encryption)"); TQString passdlgmessage=i18n("Enter passphrase (symmetrical encryption)");
int code=KPasswordDialog::getNewPassword(passphrase,passdlgmessage); int code=KPasswordDialog::getNewPassword(passphrase,passdlgmessage);
if (code!=TQDialog::Accepted) if (code!=TQDialog::Accepted)
@ -409,7 +409,7 @@ void KgpgInterface::getCmdOutput(TDEProcess *p, char *data, int )
{ {
if (userIDs.isEmpty()) if (userIDs.isEmpty())
userIDs=i18n("[No user id found]"); userIDs=i18n("[No user id found]");
TQCString passphrase; TQString passphrase;
TQString passdlgmessage; TQString passdlgmessage;
if (anonymous) if (anonymous)
passdlgmessage=i18n("<b>No user id found</b>. Trying all secret keys.<br>"); passdlgmessage=i18n("<b>No user id found</b>. Trying all secret keys.<br>");
@ -424,7 +424,8 @@ void KgpgInterface::getCmdOutput(TDEProcess *p, char *data, int )
return; return;
} }
passphrase.append("\n"); passphrase.append("\n");
p->writeStdin(passphrase,passphrase.length()); TQCString passphrase_local = passphrase.local8Bit();
p->writeStdin(passphrase_local, passphrase_local.length());
userIDs=TQString(); userIDs=TQString();
if (step>1) step--; if (step>1) step--;
else step=3; else step=3;
@ -527,7 +528,7 @@ void KgpgInterface::txtsignprocess(KProcIO *p)
else step=3; else step=3;
if (userIDs.isEmpty()) if (userIDs.isEmpty())
userIDs=i18n("[No user id found]"); userIDs=i18n("[No user id found]");
TQCString passphrase; TQString passphrase;
TQString passdlgmessage; TQString passdlgmessage;
if (step<3) if (step<3)
passdlgmessage=i18n("<b>Bad passphrase</b>. You have %1 tries left.<br>").arg(step); passdlgmessage=i18n("<b>Bad passphrase</b>. You have %1 tries left.<br>").arg(step);
@ -776,7 +777,7 @@ void KgpgInterface::readsignprocess(KProcIO *p)
else if ((required.find("passphrase.enter")!=-1)) { else if ((required.find("passphrase.enter")!=-1)) {
if (userIDs.isEmpty()) if (userIDs.isEmpty())
userIDs=i18n("[No user id found]"); userIDs=i18n("[No user id found]");
TQCString passphrase; TQString passphrase;
TQString passdlgmessage; TQString passdlgmessage;
if (step<3) if (step<3)
passdlgmessage=i18n("<b>Bad passphrase</b>. you have %1 tries left.<br>").arg(step); passdlgmessage=i18n("<b>Bad passphrase</b>. you have %1 tries left.<br>").arg(step);
@ -958,7 +959,7 @@ void KgpgInterface::sigprocess(KProcIO *p)
} }
if (required.find("passphrase.enter")!=-1) { if (required.find("passphrase.enter")!=-1) {
TQCString signpass; TQString signpass;
// kdDebug(2100) << k_funcinfo << "passphrase.enter" << endl; // kdDebug(2100) << k_funcinfo << "passphrase.enter" << endl;
TQApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
int code=KPasswordDialog::getPassword(signpass,i18n("<qt>%1 Enter passphrase for <b>%2</b>:</qt>") int code=KPasswordDialog::getPassword(signpass,i18n("<qt>%1 Enter passphrase for <b>%2</b>:</qt>")
@ -1040,7 +1041,7 @@ void KgpgInterface::sigprocess(KProcIO *p)
if (required.find("passphrase.enter")!=-1) { if (required.find("passphrase.enter")!=-1) {
TQApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
TQCString signpass; TQString signpass;
// kdDebug(2100) << k_funcinfo << "passphrase.enter" << endl; // kdDebug(2100) << k_funcinfo << "passphrase.enter" << endl;
int code=KPasswordDialog::getPassword(signpass,i18n("<qt>%1 Enter passphrase for <b>%2</b>:</qt>") int code=KPasswordDialog::getPassword(signpass,i18n("<qt>%1 Enter passphrase for <b>%2</b>:</qt>")
.arg(errMessage).arg(userIDs)); .arg(errMessage).arg(userIDs));
@ -1269,7 +1270,7 @@ void KgpgInterface::expprocess(KProcIO *p)
} }
if (required.find("passphrase.enter")!=-1) { if (required.find("passphrase.enter")!=-1) {
TQCString signpass; TQString signpass;
int code=KPasswordDialog::getPassword(signpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs)); int code=KPasswordDialog::getPassword(signpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs));
if (code!=TQDialog::Accepted) { if (code!=TQDialog::Accepted) {
expSuccess=3; ///// aborted by user mode expSuccess=3; ///// aborted by user mode
@ -1438,7 +1439,7 @@ void KgpgInterface::passprocess(KProcIO *p)
userIDs.replace(TQRegExp("<"),"&lt;"); userIDs.replace(TQRegExp("<"),"&lt;");
if (step==1) { if (step==1) {
TQCString passphrase; TQString passphrase;
int code=KPasswordDialog::getPassword(passphrase,i18n("<qt>%1 Enter passphrase for <b>%2</b></qt>") int code=KPasswordDialog::getPassword(passphrase,i18n("<qt>%1 Enter passphrase for <b>%2</b></qt>")
.arg(message).arg(userIDs)); .arg(message).arg(userIDs));
if (code!=TQDialog::Accepted) { if (code!=TQDialog::Accepted) {
@ -1453,7 +1454,7 @@ void KgpgInterface::passprocess(KProcIO *p)
} }
if (step==3) { if (step==3) {
TQCString passphrase; TQString passphrase;
int code=KPasswordDialog::getNewPassword(passphrase,i18n("<qt>Enter new passphrase for <b>%1</b><br>If you forget this passphrase, all your encrypted files and messages will be lost !<br></qt>").arg(userIDs)); int code=KPasswordDialog::getNewPassword(passphrase,i18n("<qt>Enter new passphrase for <b>%1</b><br>If you forget this passphrase, all your encrypted files and messages will be lost !<br></qt>").arg(userIDs));
if (code!=TQDialog::Accepted) { if (code!=TQDialog::Accepted) {
step=4; step=4;
@ -1689,7 +1690,7 @@ void KgpgInterface::adduidprocess(KProcIO *p)
} }
if (required.find("passphrase.enter")!=-1) { if (required.find("passphrase.enter")!=-1) {
TQCString delpass; TQString delpass;
int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>") int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>")
.arg(userIDs)); .arg(userIDs));
if (code!=TQDialog::Accepted) { if (code!=TQDialog::Accepted) {
@ -1819,7 +1820,7 @@ void KgpgInterface::delphotoprocess(KProcIO *p)
} }
if (required.find("passphrase.enter")!=-1) { if (required.find("passphrase.enter")!=-1) {
TQCString delpass; TQString delpass;
int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs)); int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs));
if (code!=TQDialog::Accepted) { if (code!=TQDialog::Accepted) {
//deleteSuccess=false; //deleteSuccess=false;
@ -1897,7 +1898,7 @@ void KgpgInterface::addphotoprocess(KProcIO *p)
} }
if (required.find("passphrase.enter")!=-1) { if (required.find("passphrase.enter")!=-1) {
TQCString delpass; TQString delpass;
int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs)); int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs));
if (code!=TQDialog::Accepted) { if (code!=TQDialog::Accepted) {
//deleteSuccess=false; //deleteSuccess=false;
@ -1991,7 +1992,7 @@ void KgpgInterface::revokeprocess(KProcIO *p)
if (required.find("passphrase.enter")!=-1) { if (required.find("passphrase.enter")!=-1) {
// kdDebug(2100) << k_funcinfo << " passphrase.enter " << endl; // kdDebug(2100) << k_funcinfo << " passphrase.enter " << endl;
TQCString signpass; TQString signpass;
int code=KPasswordDialog::getPassword(signpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs)); int code=KPasswordDialog::getPassword(signpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs));
if (code!=TQDialog::Accepted) { if (code!=TQDialog::Accepted) {
expSuccess=3; ///// aborted by user mode expSuccess=3; ///// aborted by user mode

@ -2223,7 +2223,7 @@ void listKeys::slotgenkey()
delete genkey; delete genkey;
//genkey->delayedDestruct(); //genkey->delayedDestruct();
TQCString password; TQString password;
bool goodpass=false; bool goodpass=false;
while (!goodpass) while (!goodpass)
{ {
@ -2231,7 +2231,7 @@ void listKeys::slotgenkey()
if (code!=TQDialog::Accepted) if (code!=TQDialog::Accepted)
return; return;
if (password.length()<5) if (password.length()<5)
KMessageBox::sorry(this,i18n("This passphrase is not secure enough.\nMinimum length= 5 characters")); KMessageBox::sorry(this,i18n("This passphrase is not secure enough.\nMinimum length = 5 characters"));
else else
goodpass=true; goodpass=true;
} }
@ -2283,7 +2283,7 @@ void listKeys::slotgenkey()
proc->writeStdin(TQString("Subkey-Type: ELG-E")); proc->writeStdin(TQString("Subkey-Type: ELG-E"));
proc->writeStdin(TQString("Subkey-Length:%1").arg(ksize)); proc->writeStdin(TQString("Subkey-Length:%1").arg(ksize));
} }
proc->writeStdin(TQString("Passphrase:%1").arg(password.data())); proc->writeStdin(TQString("Passphrase:%1").arg(password));
proc->writeStdin(TQString("Key-Length:%1").arg(ksize)); proc->writeStdin(TQString("Key-Length:%1").arg(ksize));
proc->writeStdin(TQString("Name-Real:%1").arg(newKeyName)); proc->writeStdin(TQString("Name-Real:%1").arg(newKeyName));
if (!newKeyMail.isEmpty()) if (!newKeyMail.isEmpty())

@ -41,12 +41,12 @@ TDEsshDialog::~TDEsshDialog()
} }
bool TDEsshDialog::checkPassword(const char *password) bool TDEsshDialog::checkPassword(const TQString &password)
{ {
SshProcess proc(m_Host, m_User); SshProcess proc(m_Host, m_User);
proc.setStub(m_Stub); proc.setStub(m_Stub);
int ret = proc.checkInstall(password); int ret = proc.checkInstall(password.local8Bit());
switch (ret) switch (ret)
{ {
case -1: case -1:

@ -23,7 +23,7 @@ public:
~TDEsshDialog(); ~TDEsshDialog();
protected: protected:
bool checkPassword(const char *password); bool checkPassword(const TQString &password);
private: private:
TQCString m_User, m_Host, m_Stub; TQCString m_User, m_Host, m_Stub;

@ -166,7 +166,7 @@ int main(int argc, char *argv[])
exit(1); exit(1);
} }
TQCString password; TQString password;
if (needpw != 0) if (needpw != 0)
{ {
TDEsshDialog *dlg = new TDEsshDialog(host, user, stub, TDEsshDialog *dlg = new TDEsshDialog(host, user, stub,
@ -188,14 +188,14 @@ int main(int argc, char *argv[])
if (keep && have_daemon) if (keep && have_daemon)
{ {
client.setHost(host); client.setHost(host);
client.setPass(password, timeout); client.setPass(password.local8Bit(), timeout);
return client.exec(command, user); return client.exec(command, user);
} else } else
{ {
proc.setCommand(command); proc.setCommand(command);
proc.setTerminal(terminal); proc.setTerminal(terminal);
proc.setErase(true); proc.setErase(true);
return proc.exec(password); return proc.exec(password.local8Bit());
} }
} }

Loading…
Cancel
Save