From 580ffcad3885e5d24e98a9dffe4962654753136e Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 30 Nov 2018 11:26:25 +0900 Subject: Adapted to new KPasswordEdit::password() signature. This relates to bug 2961. Signed-off-by: Michele Calgaro --- kgpg/kgpginterface.cpp | 33 +++++++++++++++++---------------- kgpg/listkeys.cpp | 6 +++--- 2 files changed, 20 insertions(+), 19 deletions(-) (limited to 'kgpg') diff --git a/kgpg/kgpginterface.cpp b/kgpg/kgpginterface.cpp index 0d15df2..9fb5cca 100644 --- a/kgpg/kgpginterface.cpp +++ b/kgpg/kgpginterface.cpp @@ -149,7 +149,7 @@ void KgpgInterface::readencprocess(KProcIO *p) if (required.find("openfile.overwrite.okay")!=-1) p->writeStdin(TQString("Yes")); else if ((required.find("passphrase.enter")!=-1)) { - TQCString passphrase; + TQString passphrase; int code=KPasswordDialog::getNewPassword(passphrase,i18n("Enter passphrase for your file (symmetrical encryption):")); if (code!=TQDialog::Accepted) { p->deleteLater(); @@ -226,7 +226,7 @@ void KgpgInterface::readdecprocess(KProcIO *p) if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); userIDs.replace(TQRegExp("<"),"<"); - TQCString passphrase; + TQString passphrase; TQString passdlgmessage; if (anonymous) passdlgmessage=i18n("No user id found. Trying all secret keys.
"); @@ -313,7 +313,7 @@ void KgpgInterface::txtreadencprocess(KProcIO *p) else if ((required.find("passphrase.enter")!=-1)) { - TQCString passphrase; + TQString passphrase; TQString passdlgmessage=i18n("Enter passphrase (symmetrical encryption)"); int code=KPasswordDialog::getNewPassword(passphrase,passdlgmessage); if (code!=TQDialog::Accepted) @@ -409,7 +409,7 @@ void KgpgInterface::getCmdOutput(TDEProcess *p, char *data, int ) { if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); - TQCString passphrase; + TQString passphrase; TQString passdlgmessage; if (anonymous) passdlgmessage=i18n("No user id found. Trying all secret keys.
"); @@ -424,7 +424,8 @@ void KgpgInterface::getCmdOutput(TDEProcess *p, char *data, int ) return; } passphrase.append("\n"); - p->writeStdin(passphrase,passphrase.length()); + TQCString passphrase_local = passphrase.local8Bit(); + p->writeStdin(passphrase_local, passphrase_local.length()); userIDs=TQString(); if (step>1) step--; else step=3; @@ -527,7 +528,7 @@ void KgpgInterface::txtsignprocess(KProcIO *p) else step=3; if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); - TQCString passphrase; + TQString passphrase; TQString passdlgmessage; if (step<3) passdlgmessage=i18n("Bad passphrase. You have %1 tries left.
").arg(step); @@ -776,7 +777,7 @@ void KgpgInterface::readsignprocess(KProcIO *p) else if ((required.find("passphrase.enter")!=-1)) { if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); - TQCString passphrase; + TQString passphrase; TQString passdlgmessage; if (step<3) passdlgmessage=i18n("Bad passphrase. you have %1 tries left.
").arg(step); @@ -958,7 +959,7 @@ void KgpgInterface::sigprocess(KProcIO *p) } if (required.find("passphrase.enter")!=-1) { - TQCString signpass; + TQString signpass; // kdDebug(2100) << k_funcinfo << "passphrase.enter" << endl; TQApplication::restoreOverrideCursor(); int code=KPasswordDialog::getPassword(signpass,i18n("%1 Enter passphrase for %2:") @@ -1040,7 +1041,7 @@ void KgpgInterface::sigprocess(KProcIO *p) if (required.find("passphrase.enter")!=-1) { TQApplication::restoreOverrideCursor(); - TQCString signpass; + TQString signpass; // kdDebug(2100) << k_funcinfo << "passphrase.enter" << endl; int code=KPasswordDialog::getPassword(signpass,i18n("%1 Enter passphrase for %2:") .arg(errMessage).arg(userIDs)); @@ -1269,7 +1270,7 @@ void KgpgInterface::expprocess(KProcIO *p) } if (required.find("passphrase.enter")!=-1) { - TQCString signpass; + TQString signpass; int code=KPasswordDialog::getPassword(signpass,i18n("Enter passphrase for %1:").arg(userIDs)); if (code!=TQDialog::Accepted) { expSuccess=3; ///// aborted by user mode @@ -1438,7 +1439,7 @@ void KgpgInterface::passprocess(KProcIO *p) userIDs.replace(TQRegExp("<"),"<"); if (step==1) { - TQCString passphrase; + TQString passphrase; int code=KPasswordDialog::getPassword(passphrase,i18n("%1 Enter passphrase for %2") .arg(message).arg(userIDs)); if (code!=TQDialog::Accepted) { @@ -1453,7 +1454,7 @@ void KgpgInterface::passprocess(KProcIO *p) } if (step==3) { - TQCString passphrase; + TQString passphrase; int code=KPasswordDialog::getNewPassword(passphrase,i18n("Enter new passphrase for %1
If you forget this passphrase, all your encrypted files and messages will be lost !
").arg(userIDs)); if (code!=TQDialog::Accepted) { step=4; @@ -1689,7 +1690,7 @@ void KgpgInterface::adduidprocess(KProcIO *p) } if (required.find("passphrase.enter")!=-1) { - TQCString delpass; + TQString delpass; int code=KPasswordDialog::getPassword(delpass,i18n("Enter passphrase for %1:") .arg(userIDs)); if (code!=TQDialog::Accepted) { @@ -1819,7 +1820,7 @@ void KgpgInterface::delphotoprocess(KProcIO *p) } if (required.find("passphrase.enter")!=-1) { - TQCString delpass; + TQString delpass; int code=KPasswordDialog::getPassword(delpass,i18n("Enter passphrase for %1:").arg(userIDs)); if (code!=TQDialog::Accepted) { //deleteSuccess=false; @@ -1897,7 +1898,7 @@ void KgpgInterface::addphotoprocess(KProcIO *p) } if (required.find("passphrase.enter")!=-1) { - TQCString delpass; + TQString delpass; int code=KPasswordDialog::getPassword(delpass,i18n("Enter passphrase for %1:").arg(userIDs)); if (code!=TQDialog::Accepted) { //deleteSuccess=false; @@ -1991,7 +1992,7 @@ void KgpgInterface::revokeprocess(KProcIO *p) if (required.find("passphrase.enter")!=-1) { // kdDebug(2100) << k_funcinfo << " passphrase.enter " << endl; - TQCString signpass; + TQString signpass; int code=KPasswordDialog::getPassword(signpass,i18n("Enter passphrase for %1:").arg(userIDs)); if (code!=TQDialog::Accepted) { expSuccess=3; ///// aborted by user mode diff --git a/kgpg/listkeys.cpp b/kgpg/listkeys.cpp index 2c75853..ed1d7dc 100644 --- a/kgpg/listkeys.cpp +++ b/kgpg/listkeys.cpp @@ -2223,7 +2223,7 @@ void listKeys::slotgenkey() delete genkey; //genkey->delayedDestruct(); - TQCString password; + TQString password; bool goodpass=false; while (!goodpass) { @@ -2231,7 +2231,7 @@ void listKeys::slotgenkey() if (code!=TQDialog::Accepted) return; 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 goodpass=true; } @@ -2283,7 +2283,7 @@ void listKeys::slotgenkey() proc->writeStdin(TQString("Subkey-Type: ELG-E")); 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("Name-Real:%1").arg(newKeyName)); if (!newKeyMail.isEmpty()) -- cgit v1.2.1