diff options
Diffstat (limited to 'kgpg')
-rw-r--r-- | kgpg/keygener.cpp | 2 | ||||
-rw-r--r-- | kgpg/keyinfowidget.cpp | 16 | ||||
-rw-r--r-- | kgpg/keyservers.cpp | 20 | ||||
-rw-r--r-- | kgpg/kgpg.cpp | 10 | ||||
-rw-r--r-- | kgpg/kgpginterface.cpp | 234 | ||||
-rw-r--r-- | kgpg/kgpglibrary.cpp | 2 | ||||
-rw-r--r-- | kgpg/kgpgoptions.cpp | 10 | ||||
-rw-r--r-- | kgpg/listkeys.cpp | 78 | ||||
-rw-r--r-- | kgpg/popuppublic.cpp | 16 |
9 files changed, 194 insertions, 194 deletions
diff --git a/kgpg/keygener.cpp b/kgpg/keygener.cpp index 5dfd9c7..9de17f8 100644 --- a/kgpg/keygener.cpp +++ b/kgpg/keygener.cpp @@ -99,7 +99,7 @@ void keyGenerate::slotOk() { if (KMessageBox::warningContinueCancel(this,i18n("You are about to create a key with no email address"))!=KMessageBox::Continue) return; } - else if ((vmail.tqfind(" ")!=-1) || (vmail.tqfind(".")==-1) || (vmail.tqfind("@")==-1)) { + else if ((vmail.find(" ")!=-1) || (vmail.find(".")==-1) || (vmail.find("@")==-1)) { KMessageBox::sorry(this,i18n("Email address not valid")); return; } diff --git a/kgpg/keyinfowidget.cpp b/kgpg/keyinfowidget.cpp index 1264673..50584b7 100644 --- a/kgpg/keyinfowidget.cpp +++ b/kgpg/keyinfowidget.cpp @@ -188,7 +188,7 @@ TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprin break; } - if (gpgOutput.section(':',11,11).tqfind("D",0,true)!=-1) // disabled key + if (gpgOutput.section(':',11,11).find("D",0,true)!=-1) // disabled key { tr=i18n("Disabled"); trustColor=KGpgSettings::colorBad(); @@ -241,15 +241,15 @@ TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprin } prop->kCOwnerTrust->setCurrentItem(ownerTrust); - if (fullname.tqfind("<")!=-1) { + if (fullname.find("<")!=-1) { TQString kmail=fullname; - if (fullname.tqfind(")")!=-1) + if (fullname.find(")")!=-1) kmail=kmail.section(')',1); kmail=kmail.section('<',1); kmail.truncate(kmail.length()-1); - if (kmail.tqfind("<")!=-1) //////// several email addresses in the same key + if (kmail.find("<")!=-1) //////// several email addresses in the same key { - kmail=kmail.tqreplace(">",";"); + kmail=kmail.replace(">",";"); kmail.remove("<"); } prop->tLMail->setText("<qt><a href=mailto:"+kmail+">"+kmail+"</a></qt>"); @@ -257,7 +257,7 @@ TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprin prop->tLMail->setText(i18n("none")); TQString kname=fullname.section('<',0,0); - if (fullname.tqfind("(")!=-1) { + if (fullname.find("(")!=-1) { kname=kname.section('(',0,0); TQString comment=fullname.section('(',1,1); comment=comment.section(')',0,0); @@ -265,7 +265,7 @@ TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprin } else prop->tLComment->setText(i18n("none")); - prop->tLName->setText("<qt><b>"+KgpgInterface::checkForUtf8(kname).tqreplace(TQRegExp("<"),"<")+"</b></qt>"); + prop->tLName->setText("<qt><b>"+KgpgInterface::checkForUtf8(kname).replace(TQRegExp("<"),"<")+"</b></qt>"); } if (gpgOutput.startsWith("fpr") && (fingervalue.isNull())) { @@ -332,7 +332,7 @@ void KgpgKeyInfo::finishphotoreadprocess(KProcIO *p) { TQString required=TQString(); while (p->readln(required,true)!=-1) - if (required.tqfind("keyedit.prompt")!=-1) { + if (required.find("keyedit.prompt")!=-1) { p->writeStdin(TQString("quit")); p->closeWhenDone(); diff --git a/kgpg/keyservers.cpp b/kgpg/keyservers.cpp index ce16dc1..317eef3 100644 --- a/kgpg/keyservers.cpp +++ b/kgpg/keyservers.cpp @@ -278,7 +278,7 @@ void keyServer::slotsearchread(KProcIO *p) while (p->readln(required,true)!=-1) { //required=TQString::fromUtf8(required); - if (required.tqfind("keysearch.prompt")!=-1) { + if (required.find("keysearch.prompt")!=-1) { if (count<4) p->writeStdin(TQString("N")); else { @@ -288,15 +288,15 @@ void keyServer::slotsearchread(KProcIO *p) required=TQString(); } - if (required.tqfind("GOT_IT")!=-1) { + if (required.find("GOT_IT")!=-1) { count++; required=TQString(); } - if (required.tqfind("(")==0) { + if (required.find("(")==0) { cycle=true; - TQString fullname=required.remove(0,required.tqfind(")")+1).stripWhiteSpace(); - if (fullname.tqfind("<")!=-1) { + TQString fullname=required.remove(0,required.find(")")+1).stripWhiteSpace(); + if (fullname.find("<")!=-1) { keymail=fullname.section('<',-1,-1); if (keymail.endsWith(">")) keymail.truncate(keymail.length()-1); keyname=fullname.section('<',0,0); @@ -312,7 +312,7 @@ void keyServer::slotsearchread(KProcIO *p) if ((cycle) && (!required.isEmpty())) { TQString subkey=required.stripWhiteSpace(); - if (subkey.tqfind(" key ")!=-1 && subkey.at(0).isDigit ()) + if (subkey.find(" key ")!=-1 && subkey.at(0).isDigit ()) { TQString kid=subkey.section(",",0,0).stripWhiteSpace(); kid=kid.right(8); @@ -324,7 +324,7 @@ void keyServer::slotsearchread(KProcIO *p) } else { - if (subkey.tqfind("<")!=-1) { + if (subkey.find("<")!=-1) { keymail=subkey.section('<',-1,-1); if (keymail.endsWith(">")) keymail.truncate(keymail.length()-1); keyname=subkey.section('<',0,0); @@ -472,12 +472,12 @@ void keyServer::slotimportresult(KProcess*) parsedOutput=readmessage; TQStringList importedKeys; - while (parsedOutput.tqfind("IMPORTED")!=-1) { - parsedOutput.remove(0,parsedOutput.tqfind("IMPORTED")+8); + while (parsedOutput.find("IMPORTED")!=-1) { + parsedOutput.remove(0,parsedOutput.find("IMPORTED")+8); importedKeys+=parsedOutput.section("\n",0,0).stripWhiteSpace(); } - if (readmessage.tqfind("IMPORT_RES")!=-1) { + if (readmessage.find("IMPORT_RES")!=-1) { importedNb=readmessage.section("IMPORT_RES",-1,-1); importedNb=importedNb.stripWhiteSpace(); importedNbProcess=importedNb.section(" ",0,0); diff --git a/kgpg/kgpg.cpp b/kgpg/kgpg.cpp index 33e86ec..5f1d06a 100644 --- a/kgpg/kgpg.cpp +++ b/kgpg/kgpg.cpp @@ -183,7 +183,7 @@ if (compressionScheme==0) else extension=".tar.bz2"; -if (encryptOptions.tqfind("armor")!=encryptOptions.end () ) +if (encryptOptions.find("armor")!=encryptOptions.end () ) extension+=".asc"; else if (KGpgSettings::pgpExtension()) extension+=".pgp"; @@ -602,7 +602,7 @@ static TQString getGpgHome() char *env=getenv("GNUPGHOME"); TQString gpgHome(env ? env : TQDir::homeDirPath()+"/.gnupg/"); - gpgHome.tqreplace("//", "/"); + gpgHome.replace("//", "/"); if(!gpgHome.endsWith("/")) gpgHome.append('/'); @@ -660,7 +660,7 @@ void MyView::startWizard() fp2 = popen("gpg --display-charset=utf-8 --no-tty --with-colon --list-keys "+TQFile::encodeName(tst.section(':',4,4)), "r"); while ( fgets( line, sizeof(line), fp2)) { tst2=TQString::fromUtf8(line); - if (tst2.startsWith("pub") && (trustedvals.tqfind(tst2.section(':',1,1))==-1)) { + if (tst2.startsWith("pub") && (trustedvals.find(tst2.section(':',1,1))==-1)) { counter=true; wiz->CBdefault->insertItem(tst.section(':',4,4).right(8)+": "+name); if (firstKey.isEmpty()) @@ -1029,8 +1029,8 @@ TQString newtxt=kapp->tqclipboard()->text(clipboardMode); if (newtxt.length()>300) newtxt=TQString(newtxt.left(250).stripWhiteSpace())+"...\n"+TQString(newtxt.right(40).stripWhiteSpace()); - newtxt.tqreplace(TQRegExp("<"),"<"); ///// disable html tags - newtxt.tqreplace(TQRegExp("\n"),"<br>"); + newtxt.replace(TQRegExp("<"),"<"); ///// disable html tags + newtxt.replace(TQRegExp("\n"),"<br>"); pop = new KPassivePopup( this); pop->setView(i18n("Encrypted following text:"),newtxt,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop)); diff --git a/kgpg/kgpginterface.cpp b/kgpg/kgpginterface.cpp index a564a41..ee28b3c 100644 --- a/kgpg/kgpginterface.cpp +++ b/kgpg/kgpginterface.cpp @@ -76,12 +76,12 @@ FILE *fp; void KgpgInterface::updateIDs(TQString txtString) { - int cut=txtString.tqfind(' ',22,false); + int cut=txtString.find(' ',22,false); txtString.remove(0,cut); - if (txtString.tqfind("(",0,false)!=-1) + if (txtString.find("(",0,false)!=-1) txtString=txtString.section('(',0,0)+txtString.section(')',-1); - txtString.tqreplace(TQRegExp("<"),"<"); - if (userIDs.tqfind(txtString)==-1) + txtString.replace(TQRegExp("<"),"<"); + if (userIDs.find(txtString)==-1) { if (!userIDs.isEmpty()) userIDs+=i18n(" or "); @@ -123,7 +123,7 @@ KgpgInterface::~KgpgInterface() void KgpgInterface::encryptfin(KProcess *) { - if (message.tqfind("END_ENCRYPTION")!=-1) + if (message.find("END_ENCRYPTION")!=-1) emit encryptionfinished(sourceFile); else { emit errormessage(message); @@ -134,12 +134,12 @@ void KgpgInterface::readencprocess(KProcIO *p) { TQString required; while (p->readln(required,true)!=-1) { - if (required.tqfind("BEGIN_ENCRYPTION",0,false)!=-1) + if (required.find("BEGIN_ENCRYPTION",0,false)!=-1) emit processstarted(sourceFile.path()); - if (required.tqfind("GET_")!=-1) { - if (required.tqfind("openfile.overwrite.okay")!=-1) + if (required.find("GET_")!=-1) { + if (required.find("openfile.overwrite.okay")!=-1) p->writeStdin(TQString("Yes")); - else if ((required.tqfind("passphrase.enter")!=-1)) { + else if ((required.find("passphrase.enter")!=-1)) { TQCString passphrase; int code=KPasswordDialog::getNewPassword(passphrase,i18n("Enter passphrase for your file (symmetrical encryption):")); if (code!=TQDialog::Accepted) { @@ -187,7 +187,7 @@ void KgpgInterface::KgpgDecryptFile(KURL srcUrl,KURL destUrl,TQStringList Option void KgpgInterface::decryptfin(KProcess *) { - if ((message.tqfind("DECRYPTION_OKAY")!=-1) && (message.tqfind("END_DECRYPTION")!=-1)) //&& (message.tqfind("GOODMDC")!=-1) + if ((message.find("DECRYPTION_OKAY")!=-1) && (message.find("END_DECRYPTION")!=-1)) //&& (message.find("GOODMDC")!=-1) emit decryptionfinished(); else emit errormessage(message); @@ -198,22 +198,22 @@ void KgpgInterface::readdecprocess(KProcIO *p) { TQString required; while (p->readln(required,true)!=-1) { - if (required.tqfind("BEGIN_DECRYPTION",0,false)!=-1) + if (required.find("BEGIN_DECRYPTION",0,false)!=-1) emit processstarted(decryptUrl); - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); - if (required.tqfind("ENC_TO")!=-1) { - if (required.tqfind("0000000000000000")!=-1) + if (required.find("ENC_TO")!=-1) { + if (required.find("0000000000000000")!=-1) anonymous=true; } - if (required.tqfind("GET_")!=-1) { - if (required.tqfind("openfile.overwrite.okay")!=-1) + if (required.find("GET_")!=-1) { + if (required.find("openfile.overwrite.okay")!=-1) p->writeStdin(TQString("Yes")); - else if ((required.tqfind("passphrase.enter")!=-1)) { + else if ((required.find("passphrase.enter")!=-1)) { if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); - userIDs.tqreplace(TQRegExp("<"),"<"); + userIDs.replace(TQRegExp("<"),"<"); TQCString passphrase; TQString passdlgmessage; if (anonymous) @@ -289,14 +289,14 @@ void KgpgInterface::txtreadencprocess(KProcIO *p) { TQString required; while (p->readln(required,true)!=-1) { - if (required.tqfind("BEGIN_ENCRYPTION",0,false)!=-1) + if (required.find("BEGIN_ENCRYPTION",0,false)!=-1) { p->writeStdin(txtToEncrypt,false); txtToEncrypt=TQString(); p->closeWhenDone(); } else - if ((required.tqfind("passphrase.enter")!=-1)) + if ((required.find("passphrase.enter")!=-1)) { TQCString passphrase; TQString passdlgmessage=i18n("Enter passphrase (symmetrical encryption)"); @@ -370,23 +370,23 @@ void KgpgInterface::getCmdOutput(KProcess *p, char *data, int ) log.append(data); int pos; - while ((pos=gpgOutput.tqfind("\n"))!=-1) + while ((pos=gpgOutput.find("\n"))!=-1) { TQString required=gpgOutput.left(pos); gpgOutput.remove(0,pos+2); - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); - if (required.tqfind("ENC_TO")!=-1) + if (required.find("ENC_TO")!=-1) { - if (required.tqfind("0000000000000000")!=-1) + if (required.find("0000000000000000")!=-1) anonymous=true; } - if (required.tqfind("GET_")!=-1) + if (required.find("GET_")!=-1) { - if ((required.tqfind("passphrase.enter")!=-1)) + if ((required.find("passphrase.enter")!=-1)) { if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); @@ -417,16 +417,16 @@ void KgpgInterface::getCmdOutput(KProcess *p, char *data, int ) } } - if (required.tqfind("BEGIN_DECRYPTION")!=-1) + if (required.find("BEGIN_DECRYPTION")!=-1) { p->closeStdin(); required=TQString(); } - if (required.tqfind("END_DECRYPTION")!=-1) decfinished=true; - if (required.tqfind("DECRYPTION_OKAY")!=-1) decok=true; - if (required.tqfind("DECRYPTION_FAILED")!=-1) decok=false; - if (required.tqfind("BADMDC")!=-1) badmdc=true; + if (required.find("END_DECRYPTION")!=-1) decfinished=true; + if (required.find("DECRYPTION_OKAY")!=-1) decok=true; + if (required.find("DECRYPTION_FAILED")!=-1) decok=false; + if (required.find("BADMDC")!=-1) badmdc=true; } } ////////////////////////////////////////////////////////////////////////////////////////////////////////// Text signing @@ -482,17 +482,17 @@ void KgpgInterface::txtsignprocess(KProcIO *p) while (p->readln(required,true)!=-1) { // kdDebug(2100)<<"SIGNING: "<<required<<endl; - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); - if (required.tqfind("GOOD_PASSPHRASE")!=-1) + if (required.find("GOOD_PASSPHRASE")!=-1) { p->writeStdin(message,true); message=TQString(); p->closeWhenDone(); } - if ((required.tqfind("passphrase.enter")!=-1)) + if ((required.find("passphrase.enter")!=-1)) { if (step>1) step--; else step=3; @@ -586,13 +586,13 @@ TQString required; required=required.section("]",1,-1).stripWhiteSpace(); if (required.startsWith("GOODSIG")) { - TQString userName=required.section(" ",2,-1).tqreplace(TQRegExp("<"),"<"); + TQString userName=required.section(" ",2,-1).replace(TQRegExp("<"),"<"); userName=checkForUtf8(userName); signID=i18n("<qt>Good signature from:<br><b>%1</b><br>Key ID: %2</qt>").tqarg(userName).tqarg("0x"+required.section(" ",1,1).right(8)); } if (required.startsWith("BADSIG")) { - signID=i18n("<qt><b>Bad signature</b> from:<br>%1<br>Key ID: %2<br><br><b>Text is corrupted.</b></qt>").tqarg(required.section(" ",2,-1).tqreplace(TQRegExp("<"),"<")).tqarg("0x"+required.section(" ",1,1).right(8)); + signID=i18n("<qt><b>Bad signature</b> from:<br>%1<br>Key ID: %2<br><br><b>Text is corrupted.</b></qt>").tqarg(required.section(" ",2,-1).replace(TQRegExp("<"),"<")).tqarg("0x"+required.section(" ",1,1).right(8)); } if (required.startsWith("NO_PUBKEY")) { @@ -670,8 +670,8 @@ void Md5Widget::slotApply() text = cb->text(TQClipboard::Clipboard); if ( !text.isEmpty() ) { text=text.stripWhiteSpace(); - while (text.tqfind(' ')!=-1) - text.remove(text.tqfind(' '),1); + while (text.find(' ')!=-1) + text.remove(text.find(' '),1); if (text==mdSum) { TextLabel1_2->setText(i18n("<b>Correct checksum</b>, file is ok.")); KLed1->setColor(TQColor(0,255,0)); @@ -714,9 +714,9 @@ void KgpgInterface::KgpgSignFile(TQString keyID,KURL srcUrl,TQStringList Options void KgpgInterface::signfin(KProcess *) { - if (message.tqfind("SIG_CREATED")!=-1) + if (message.find("SIG_CREATED")!=-1) KMessageBox::information(0,i18n("The signature file %1 was successfully created.").tqarg(file.fileName())); - else if (message.tqfind("BAD_PASSPHRASE")!=-1) + else if (message.find("BAD_PASSPHRASE")!=-1) KMessageBox::sorry(0,i18n("Bad passphrase, signature was not created.")); else KMessageBox::sorry(0,message); @@ -728,13 +728,13 @@ void KgpgInterface::readsignprocess(KProcIO *p) { TQString required; while (p->readln(required,true)!=-1) { - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); - if (required.tqfind("GET_")!=-1) { - if (required.tqfind("openfile.overwrite.okay")!=-1) + if (required.find("GET_")!=-1) { + if (required.find("openfile.overwrite.okay")!=-1) p->writeStdin(TQString("Yes")); - else if ((required.tqfind("passphrase.enter")!=-1)) { + else if ((required.find("passphrase.enter")!=-1)) { if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); TQCString passphrase; @@ -790,7 +790,7 @@ TQString required; while (p->readln(required,true)!=-1) { message+=required+"\n"; - if (required.tqfind("GET_")!=-1) { + if (required.find("GET_")!=-1) { p->writeStdin(TQString("quit")); p->closeWhenDone(); } @@ -799,12 +799,12 @@ TQString required; signID=i18n("No signature found."); if (required.startsWith("GOODSIG")) { - signID=i18n("<qt>Good signature from:<br><b>%1</b><br>Key ID: %2</qt>").tqarg(required.section(" ",2,-1).tqreplace(TQRegExp("<"),"<")).tqarg("0x"+required.section(" ",1,1).right(8)); + signID=i18n("<qt>Good signature from:<br><b>%1</b><br>Key ID: %2</qt>").tqarg(required.section(" ",2,-1).replace(TQRegExp("<"),"<")).tqarg("0x"+required.section(" ",1,1).right(8)); } if (required.startsWith("BADSIG")) { signID=i18n("<qt><b>BAD signature</b> from:<br> %1<br>Key id: %2<br><br>" - "<b>The file is corrupted!</b></qt>").tqarg(required.section(" ",2,-1).tqreplace(TQRegExp("<"),"<")).tqarg("0x"+required.section(" ",1,1).right(8)); + "<b>The file is corrupted!</b></qt>").tqarg(required.section(" ",2,-1).replace(TQRegExp("<"),"<")).tqarg("0x"+required.section(" ",1,1).right(8)); } if (required.startsWith("NO_PUBKEY")) { @@ -839,7 +839,7 @@ void KgpgInterface::verifyfin(KProcess *) void KgpgInterface::KgpgSignKey(TQString keyID,TQString signKeyID,TQString signKeyMail,bool local,int checking) { - signKeyMail.tqreplace(TQRegExp("<"),"<"); + signKeyMail.replace(TQRegExp("<"),"<"); konsChecked=checking; konsLocal=local; konsSignKey=signKeyID; @@ -872,40 +872,40 @@ void KgpgInterface::sigprocess(KProcIO *p) { output+=required+"\n"; - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); if (signSuccess==4) { - if (required.tqfind("GET_")!=-1) + if (required.find("GET_")!=-1) p->writeStdin(TQString("quit")); p->closeWhenDone(); return; } - if ((required.tqfind("GOOD_PASSPHRASE")!=-1)) { + if ((required.find("GOOD_PASSPHRASE")!=-1)) { signSuccess=3; step=2; } - if (required.tqfind("sign_uid.expire")!=-1) { + if (required.find("sign_uid.expire")!=-1) { p->writeStdin(TQString("Never")); required=TQString(); } - if (required.tqfind("sign_uid.class")!=-1) { + if (required.find("sign_uid.class")!=-1) { p->writeStdin(TQString::number(konsChecked)); required=TQString(); } - if (required.tqfind("sign_uid.okay")!=-1) { + if (required.find("sign_uid.okay")!=-1) { p->writeStdin(TQString("Y")); required=TQString(); } - if (required.tqfind("sign_all.okay")!=-1) { + if (required.find("sign_all.okay")!=-1) { p->writeStdin(TQString("Y")); required=TQString(); } - if (required.tqfind("passphrase.enter")!=-1) { + if (required.find("passphrase.enter")!=-1) { TQCString signpass; int code=KPasswordDialog::getPassword(signpass,i18n("<qt>%1 Enter passphrase for <b>%2</b>:</qt>") .tqarg(errMessage).tqarg(userIDs)); @@ -920,16 +920,16 @@ void KgpgInterface::sigprocess(KProcIO *p) required=TQString(); // step=2; } - if ((step==2) && (required.tqfind("keyedit.prompt")!=-1)) { + if ((step==2) && (required.find("keyedit.prompt")!=-1)) { p->writeStdin(TQString("save")); required=TQString(); } - if (required.tqfind("BAD_PASSPHRASE")!=-1) { + if (required.find("BAD_PASSPHRASE")!=-1) { errMessage=i18n("<b>Bad passphrase</b>. Try again.</br>"); required=TQString(); signSuccess=2; ///// bad passphrase } - if (required.tqfind("GET_")!=-1) /////// gpg asks for something unusal, turn to konsole mode + if (required.find("GET_")!=-1) /////// gpg asks for something unusal, turn to konsole mode { if (signSuccess!=2) signSuccess=1; ///// switching to console mode @@ -997,7 +997,7 @@ void KgpgInterface::KgpgDelSignature(TQString keyID,TQString signKeyID) while ( fgets( buffer, sizeof(buffer), fp)) { encResult=buffer; if (encResult.startsWith("sig")) { - if (encResult.tqfind(message)!=-1) + if (encResult.find(message)!=-1) break; signb++; } else if (encResult.startsWith("rev")) @@ -1019,7 +1019,7 @@ void KgpgInterface::delsigprocess(KProcIO *p) TQString required=TQString(); while (p->readln(required,true)!=-1) { - if (required.tqfind("keyedit.delsig")!=-1){ + if (required.find("keyedit.delsig")!=-1){ if ((sigsearch==signb) && (step==0)) { p->writeStdin(TQString("Y")); @@ -1029,12 +1029,12 @@ void KgpgInterface::delsigprocess(KProcIO *p) sigsearch++; required=TQString(); } - if ((step==1) && (required.tqfind("keyedit.prompt")!=-1)) { + if ((step==1) && (required.find("keyedit.prompt")!=-1)) { p->writeStdin(TQString("save")); required=TQString(); deleteSuccess=true; } - if (required.tqfind("GET_LINE")!=-1) { + if (required.find("GET_LINE")!=-1) { p->writeStdin(TQString("quit")); p->closeWhenDone(); deleteSuccess=false; @@ -1097,20 +1097,20 @@ void KgpgInterface::expprocess(KProcIO *p) while (p->readln(required,true)!=-1) { output+=required+"\n"; - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); - if ((required.tqfind("GOOD_PASSPHRASE")!=-1)) { + if ((required.find("GOOD_PASSPHRASE")!=-1)) { expSuccess=3; step=2; } - if (required.tqfind("keygen.valid")!=-1) { + if (required.find("keygen.valid")!=-1) { p->writeStdin(TQString::number(expirationDelay)); required=TQString(); } - if (required.tqfind("passphrase.enter")!=-1) { + if (required.find("passphrase.enter")!=-1) { TQCString signpass; int code=KPasswordDialog::getPassword(signpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").tqarg(userIDs)); if (code!=TQDialog::Accepted) { @@ -1123,22 +1123,22 @@ void KgpgInterface::expprocess(KProcIO *p) required=TQString(); // step=2; } - if ((step==2) && (required.tqfind("keyedit.prompt")!=-1)) { + if ((step==2) && (required.find("keyedit.prompt")!=-1)) { p->writeStdin(TQString("save")); p->closeWhenDone(); required=TQString(); } - if ((step==2) && (required.tqfind("keyedit.save.okay")!=-1)) { + if ((step==2) && (required.find("keyedit.save.okay")!=-1)) { p->writeStdin(TQString("YES")); p->closeWhenDone(); required=TQString(); } - if (required.tqfind("BAD_PASSPHRASE")!=-1) { + if (required.find("BAD_PASSPHRASE")!=-1) { p->writeStdin(TQString("quit")); p->closeWhenDone(); expSuccess=2; ///// bad passphrase } - if ((required.tqfind("GET_")!=-1) && (expSuccess!=2)) /////// gpg asks for something unusal, turn to konsole mode + if ((required.find("GET_")!=-1) && (expSuccess!=2)) /////// gpg asks for something unusal, turn to konsole mode { expSuccess=1; ///// switching to console mode p->writeStdin(TQString("quit")); @@ -1189,23 +1189,23 @@ void KgpgInterface::trustprocess(KProcIO *p) TQString required=TQString(); while (p->readln(required,true)!=-1) { output+=required+"\n"; - if (required.tqfind("edit_ownertrust.set_ultimate.okay")!=-1) { + if (required.find("edit_ownertrust.set_ultimate.okay")!=-1) { p->writeStdin(TQString("YES")); required=TQString(); } - if (required.tqfind("edit_ownertrust.value")!=-1) { + if (required.find("edit_ownertrust.value")!=-1) { p->writeStdin(TQString::number(trustValue)); required=TQString(); } - if (required.tqfind("keyedit.prompt")!=-1) { + if (required.find("keyedit.prompt")!=-1) { p->writeStdin(TQString("save")); p->closeWhenDone(); required=TQString(); } - if (required.tqfind("GET_")!=-1) /////// gpg asks for something unusal, turn to konsole mode + if (required.find("GET_")!=-1) /////// gpg asks for something unusal, turn to konsole mode { expSuccess=1; ///// switching to console mode p->writeStdin(TQString("quit")); @@ -1247,10 +1247,10 @@ void KgpgInterface::passprocess(KProcIO *p) while (p->readln(required,true)!=-1) { output+=required+"\n"; - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); - if ((step>2) && (required.tqfind("keyedit.prompt")!=-1)) { + if ((step>2) && (required.find("keyedit.prompt")!=-1)) { if (step==3) { emit passwordChanged(); @@ -1260,18 +1260,18 @@ void KgpgInterface::passprocess(KProcIO *p) required=TQString(); } - if ((required.tqfind("GOOD_PASSPHRASE")!=-1) && (step==2)) + if ((required.find("GOOD_PASSPHRASE")!=-1) && (step==2)) step=3; - if ((required.tqfind("BAD_PASSPHRASE")!=-1) && (step==2)) { + if ((required.find("BAD_PASSPHRASE")!=-1) && (step==2)) { step=1; message=i18n("<b>Bad passphrase</b>. Try again<br>"); } - if ((required.tqfind("passphrase.enter")!=-1)) { + if ((required.find("passphrase.enter")!=-1)) { if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); - userIDs.tqreplace(TQRegExp("<"),"<"); + userIDs.replace(TQRegExp("<"),"<"); if (step==1) { TQCString passphrase; @@ -1307,7 +1307,7 @@ void KgpgInterface::passprocess(KProcIO *p) } - if (required.tqfind("GET_")!=-1) /////// gpg asks for something unusal, turn to konsole mode + if (required.find("GET_")!=-1) /////// gpg asks for something unusal, turn to konsole mode { p->writeStdin(TQString("quit")); p->closeWhenDone(); @@ -1394,14 +1394,14 @@ kdDebug(2100)<<"Importing is over"<<endl; TQString parsedOutput=message; TQStringList importedKeys; - while (parsedOutput.tqfind("IMPORTED")!=-1) { - parsedOutput.remove(0,parsedOutput.tqfind("IMPORTED")+8); + while (parsedOutput.find("IMPORTED")!=-1) { + parsedOutput.remove(0,parsedOutput.find("IMPORTED")+8); importedKeys<<parsedOutput.section("\n",0,0).stripWhiteSpace(); importedKeysIds<<parsedOutput.stripWhiteSpace().section(' ',0,0); } - if (message.tqfind("IMPORT_RES")!=-1) { + if (message.find("IMPORT_RES")!=-1) { parsedOutput=message.section("IMPORT_RES",-1,-1).stripWhiteSpace(); messageList=TQStringList::split(" ",parsedOutput,true); @@ -1460,7 +1460,7 @@ void KgpgInterface::importprocess(KProcIO *p) { TQString outp; while (p->readln(outp)!=-1) { - if (outp.tqfind("http-proxy")==-1) + if (outp.find("http-proxy")==-1) message+=outp+"\n"; } } @@ -1496,25 +1496,25 @@ void KgpgInterface::adduidprocess(KProcIO *p) TQString required=TQString(); while (p->readln(required,true)!=-1) { output+=required+"\n"; - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); - if (required.tqfind("keygen.name")!=-1) { + if (required.find("keygen.name")!=-1) { p->writeStdin(uidName); required=TQString(); } - if (required.tqfind("keygen.email")!=-1) { + if (required.find("keygen.email")!=-1) { p->writeStdin(uidEmail); required=TQString(); } - if (required.tqfind("keygen.comment")!=-1) { + if (required.find("keygen.comment")!=-1) { p->writeStdin(uidComment); required=TQString(); } - if (required.tqfind("passphrase.enter")!=-1) { + if (required.find("passphrase.enter")!=-1) { TQCString delpass; int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>") .tqarg(userIDs)); @@ -1529,12 +1529,12 @@ void KgpgInterface::adduidprocess(KProcIO *p) } - if (required.tqfind("keyedit.prompt")!=-1) { + if (required.find("keyedit.prompt")!=-1) { p->writeStdin(TQString("save")); required=TQString(); } - if ((required.tqfind("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode + if ((required.find("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode { kdDebug(2100)<<"unknown request"<<endl; addSuccess=false; ///// switching to console mode @@ -1629,15 +1629,15 @@ void KgpgInterface::delphotoprocess(KProcIO *p) TQString required=TQString(); while (p->readln(required,true)!=-1) { output+=required+"\n"; - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); - if (required.tqfind("keyedit.remove.uid.okay")!=-1) { + if (required.find("keyedit.remove.uid.okay")!=-1) { p->writeStdin(TQString("YES")); required=TQString(); } - if (required.tqfind("passphrase.enter")!=-1) { + if (required.find("passphrase.enter")!=-1) { TQCString delpass; int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").tqarg(userIDs)); if (code!=TQDialog::Accepted) { @@ -1651,12 +1651,12 @@ void KgpgInterface::delphotoprocess(KProcIO *p) } - if (required.tqfind("keyedit.prompt")!=-1) { + if (required.find("keyedit.prompt")!=-1) { p->writeStdin(TQString("save")); required=TQString(); } - if ((required.tqfind("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode + if ((required.find("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode { kdDebug(2100)<<"unknown request"<<endl; delSuccess=false; @@ -1692,15 +1692,15 @@ void KgpgInterface::addphotoprocess(KProcIO *p) TQString required=TQString(); while (p->readln(required,true)!=-1) { output+=required+"\n"; - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); - if (required.tqfind("photoid.jpeg.add")!=-1) { + if (required.find("photoid.jpeg.add")!=-1) { p->writeStdin(photoUrl); required=TQString(); } - if (required.tqfind("photoid.jpeg.size")!=-1) { + if (required.find("photoid.jpeg.size")!=-1) { if (KMessageBox::questionYesNo(0,i18n("This image is very large. Use it anyway?"), TQString(), i18n("Use Anyway"), i18n("Do Not Use"))==KMessageBox::Yes) p->writeStdin(TQString("Yes")); else @@ -1712,7 +1712,7 @@ void KgpgInterface::addphotoprocess(KProcIO *p) required=TQString(); } - if (required.tqfind("passphrase.enter")!=-1) { + if (required.find("passphrase.enter")!=-1) { TQCString delpass; int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").tqarg(userIDs)); if (code!=TQDialog::Accepted) { @@ -1726,12 +1726,12 @@ void KgpgInterface::addphotoprocess(KProcIO *p) } - if (required.tqfind("keyedit.prompt")!=-1) { + if (required.find("keyedit.prompt")!=-1) { p->writeStdin(TQString("save")); required=TQString(); } - if ((required.tqfind("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode + if ((required.find("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode { kdDebug(2100)<<"unknown request"<<endl; p->writeStdin(TQString("quit")); @@ -1782,23 +1782,23 @@ void KgpgInterface::revokeprocess(KProcIO *p) while (p->readln(required,true)!=-1) { output+=required+"\n"; - if (required.tqfind("USERID_HINT",0,false)!=-1) + if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); - if ((required.tqfind("GOOD_PASSPHRASE")!=-1)) + if ((required.find("GOOD_PASSPHRASE")!=-1)) revokeSuccess=true; - if ((required.tqfind("gen_revoke.okay")!=-1) || (required.tqfind("ask_revocation_reason.okay")!=-1) || (required.tqfind("openfile.overwrite.okay")!=-1)) { + if ((required.find("gen_revoke.okay")!=-1) || (required.find("ask_revocation_reason.okay")!=-1) || (required.find("openfile.overwrite.okay")!=-1)) { p->writeStdin(TQString("YES")); required=TQString(); } - if (required.tqfind("ask_revocation_reason.code")!=-1) { + if (required.find("ask_revocation_reason.code")!=-1) { p->writeStdin(TQString::number(revokeReason)); required=TQString(); } - if (required.tqfind("passphrase.enter")!=-1) { + if (required.find("passphrase.enter")!=-1) { TQCString signpass; int code=KPasswordDialog::getPassword(signpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").tqarg(userIDs)); if (code!=TQDialog::Accepted) { @@ -1811,13 +1811,13 @@ void KgpgInterface::revokeprocess(KProcIO *p) required=TQString(); } - if (required.tqfind("ask_revocation_reason.text")!=-1) { + if (required.find("ask_revocation_reason.text")!=-1) { // kdDebug(2100)<<"description"<<endl; p->writeStdin(revokeDescription); revokeDescription=TQString(); required=TQString(); } - if ((required.tqfind("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode + if ((required.find("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode { kdDebug(2100)<<"unknown request"<<endl; expSuccess=1; ///// switching to console mode @@ -2119,7 +2119,7 @@ void KgpgInterface::setGpgBoolSetting(TQString name,bool enable,TQString url) TQString KgpgInterface::checkForUtf8bis(TQString txt) { - if (strchr (txt.ascii(), 0xc3) || (txt.tqfind("\\x")!=-1)) + if (strchr (txt.ascii(), 0xc3) || (txt.find("\\x")!=-1)) txt=checkForUtf8(txt); else { txt=checkForUtf8(txt); @@ -2141,18 +2141,18 @@ TQString KgpgInterface::checkForUtf8(TQString txt) for (s = txt.ascii(); *s && !(*s & 0x80); s++) ; - if (*s && !strchr (txt.ascii(), 0xc3) && (txt.tqfind("\\x")==-1)) + if (*s && !strchr (txt.ascii(), 0xc3) && (txt.find("\\x")==-1)) return txt; /* The string is not in UTF-8 */ //if (strchr (txt.ascii(), 0xc3)) return (txt+" +++"); - if (txt.tqfind("\\x")==-1) + if (txt.find("\\x")==-1) return TQString::fromUtf8(txt.ascii()); - // if (!strchr (txt.ascii(), 0xc3) || (txt.tqfind("\\x")!=-1)) { - for ( int idx = 0 ; (idx = txt.tqfind( "\\x", idx )) >= 0 ; ++idx ) { + // if (!strchr (txt.ascii(), 0xc3) || (txt.find("\\x")!=-1)) { + for ( int idx = 0 ; (idx = txt.find( "\\x", idx )) >= 0 ; ++idx ) { char str[2] = "x"; str[0] = (char) TQString( txt.mid( idx + 2, 2 ) ).toShort( 0, 16 ); - txt.tqreplace( idx, 4, str ); + txt.replace( idx, 4, str ); } if (!strchr (txt.ascii(), 0xc3)) return TQString::fromUtf8(txt.ascii()); diff --git a/kgpg/kgpglibrary.cpp b/kgpg/kgpglibrary.cpp index c0730b3..cfa80da 100644 --- a/kgpg/kgpglibrary.cpp +++ b/kgpg/kgpglibrary.cpp @@ -84,7 +84,7 @@ void KgpgLibrary::fastencode(KURL &fileToCrypt,TQStringList selec,TQStringList e } urlselected=fileToCrypt; KURL dest; - if (encryptOptions.tqfind("--armor")!=encryptOptions.end()) + if (encryptOptions.find("--armor")!=encryptOptions.end()) dest.setPath(urlselected.path()+".asc"); else dest.setPath(urlselected.path()+extension); diff --git a/kgpg/kgpgoptions.cpp b/kgpg/kgpgoptions.cpp index ef6c061..a4ffa36 100644 --- a/kgpg/kgpgoptions.cpp +++ b/kgpg/kgpgoptions.cpp @@ -416,7 +416,7 @@ void kgpgOptions::updateSettings() for (uint i=0;i<page6->ServerBox->count();i++) { TQString currItem=page6->ServerBox->text(i); - if (currItem.tqfind(" ")!=-1) // it is the default keyserver + if (currItem.find(" ")!=-1) // it is the default keyserver keyServer=currItem.section(" ",0,0); else { @@ -538,7 +538,7 @@ void kgpgOptions::listkey() tst=line; if (tst.startsWith("pub")) { name=KgpgInterface::checkForUtf8(tst.section(':',9,9)); - if ((!name.isEmpty()) && (trustedvals.tqfind(tst.section(':',1,1))==-1)) { + if ((!name.isEmpty()) && (trustedvals.find(tst.section(':',1,1))==-1)) { counter++; //name=name.section('<',-1,-1); // name=name.section('>',0,0); @@ -546,7 +546,7 @@ void kgpgOptions::listkey() ids+=tst.section(':',4,4); if (tst.section(':',4,4).right(8)==alwaysKeyID) alwaysKeyName=tst.section(':',4,4).right(8)+":"+name; - if (issec.tqfind(tst.section(':',4,4).right(8),0,FALSE)!=-1) + if (issec.find(tst.section(':',4,4).right(8),0,FALSE)!=-1) { //*** page1->file_key->insertItem(pixkeyDouble,tst.section(':',4,4).right(8)+":"+name); //*** page1->always_key->insertItem(pixkeyDouble,tst.section(':',4,4).right(8)+":"+name); @@ -572,13 +572,13 @@ void kgpgOptions::slotAddKeyServer() TQString newServer=KInputDialog::getText(i18n("Add New Key Server"),i18n("Server URL:")); if (!newServer.isEmpty()) page6->ServerBox->insertItem(newServer.stripWhiteSpace()); -page6->ServerBox->setSelected(page6->ServerBox->tqfindItem(newServer.stripWhiteSpace()),true); +page6->ServerBox->setSelected(page6->ServerBox->findItem(newServer.stripWhiteSpace()),true); } void kgpgOptions::slotDelKeyServer() { bool defaultDeleted=false; -if (page6->ServerBox->currentText().tqfind(" ")!=-1) defaultDeleted=true; +if (page6->ServerBox->currentText().find(" ")!=-1) defaultDeleted=true; page6->ServerBox->removeItem(page6->ServerBox->currentItem()); page6->ServerBox->setSelected(0,true); if (defaultDeleted) page6->ServerBox->changeItem(page6->ServerBox->currentText().section(" ",0,0)+" "+i18n("(Default)"),0); diff --git a/kgpg/listkeys.cpp b/kgpg/listkeys.cpp index 4d2aa08..1d25ccf 100644 --- a/kgpg/listkeys.cpp +++ b/kgpg/listkeys.cpp @@ -271,12 +271,12 @@ KDialogBase( tqparent, name, true,i18n("Private Key List"),Ok | Cancel) dead=false; break; case '-': - if (tst2.section(':',11,11).tqfind('D')==-1) warn=true; + if (tst2.section(':',11,11).find('D')==-1) warn=true; break; default: break; } - if (tst2.section(':',11,11).tqfind('D')!=-1) + if (tst2.section(':',11,11).find('D')!=-1) dead=true; break; } @@ -284,7 +284,7 @@ KDialogBase( tqparent, name, true,i18n("Private Key List"),Ok | Cancel) pclose(fp2); if (!fullname.isEmpty() && (!dead)) { TQString keyMail,keyName; - if (fullname.tqfind("<")!=-1) { + if (fullname.find("<")!=-1) { keyMail=fullname.section('<',-1,-1); keyMail.truncate(keyMail.length()-1); keyName=fullname.section('<',0,0); @@ -301,7 +301,7 @@ KDialogBase( tqparent, name, true,i18n("Private Key List"),Ok | Cancel) KListViewItem *sub= new KListViewItem(item,i18n("Expiration:"),val); sub->setSelectable(false); item->setPixmap(0,keyPair); - if (preselected.tqfind(id,0,false)!=-1) { + if (preselected.find(id,0,false)!=-1) { keysListpr->setSelected(item,true); keysListpr->setCurrentItem(item); selectedok=true; @@ -506,7 +506,7 @@ void mySearchLine::updateSearch(const TQString& s) { if (item->isVisible() && !(item->text(6).isEmpty())) { - if (searchListView->displayOnlySecret && searchListView->secretList.tqfind(item->text(6))==-1) + if (searchListView->displayOnlySecret && searchListView->secretList.find(item->text(6))==-1) item->setVisible(false); if (!searchListView->displayDisabled && item->pixmap(2)) if (item->pixmap(2)->serialNumber()==disabledSerial) @@ -838,7 +838,7 @@ void listKeys::slotToggleDisabled() void listKeys::slotGotoDefaultKey() { - TQListViewItem *myDefaulKey = keysList2->tqfindItem(KGpgSettings::defaultKey(),6); + TQListViewItem *myDefaulKey = keysList2->findItem(KGpgSettings::defaultKey(),6); keysList2->clearSelection(); keysList2->setCurrentItem(myDefaulKey); keysList2->setSelected(myDefaulKey,true); @@ -1006,7 +1006,7 @@ void listKeys::slotSetPhotoSize(int size) TQListViewItem *newdef = keysList2->firstChild(); while (newdef) { - //if ((keysList2->photoKeysList.tqfind(newdef->text(6))!=-1) && (newdef->childCount ()>0)) + //if ((keysList2->photoKeysList.find(newdef->text(6))!=-1) && (newdef->childCount ()>0)) if (newdef->childCount ()>0) { bool hasphoto=false; TQListViewItem *newdefChild = newdef->firstChild(); @@ -1049,19 +1049,19 @@ void listKeys::findFirstKey() // - KFind *m_tqfind = new KFind(searchString, searchOptions,this); - m_tqfind->setData(searchText); - while (m_tqfind->find()==KFind::NoMatch) { + KFind *m_find = new KFind(searchString, searchOptions,this); + m_find->setData(searchText); + while (m_find->find()==KFind::NoMatch) { if (!item->nextSibling()) { foundItem=false; break; } else { item = item->nextSibling(); searchText=item->text(0)+" "+item->text(1)+" "+item->text(6); - m_tqfind->setData(searchText); + m_find->setData(searchText); } } - delete m_tqfind; + delete m_find; if (foundItem) { @@ -1091,20 +1091,20 @@ void listKeys::findNextKey() //kdDebug(2100)<<"Next string:"<<searchText<<endl; //kdDebug(2100)<<"Search:"<<searchString<<endl; //kdDebug(2100)<<"OPts:"<<searchOptions<<endl; - KFind *m_tqfind = new KFind(searchString, searchOptions,this); - m_tqfind->setData(searchText); - while (m_tqfind->find()==KFind::NoMatch) { + KFind *m_find = new KFind(searchString, searchOptions,this); + m_find->setData(searchText); + while (m_find->find()==KFind::NoMatch) { if (!item->nextSibling()) { foundItem=false; break; } else { item = item->nextSibling(); searchText=item->text(0)+" "+item->text(1)+" "+item->text(6); - m_tqfind->setData(searchText); + m_find->setData(searchText); //kdDebug(2100)<<"Next string:"<<searchText<<endl; } } - delete m_tqfind; + delete m_find; if (foundItem) { keysList2->clearSelection(); keysList2->setCurrentItem(item); @@ -1309,7 +1309,7 @@ void listKeys::slotSetDefKey() void listKeys::slotSetDefaultKey(TQString newID) { - TQListViewItem *newdef = keysList2->tqfindItem(newID,6); + TQListViewItem *newdef = keysList2->findItem(newID,6); if (newdef) slotSetDefaultKey(newdef); } @@ -1328,7 +1328,7 @@ void listKeys::slotSetDefaultKey(TQListViewItem *newdef) return; } - TQListViewItem *olddef = keysList2->tqfindItem(KGpgSettings::defaultKey(),6); + TQListViewItem *olddef = keysList2->findItem(KGpgSettings::defaultKey(),6); KGpgSettings::setDefaultKey(newdef->text(6)); KGpgSettings::writeConfig(); @@ -1382,10 +1382,10 @@ void listKeys::slotmenu(TQListViewItem *sel, const TQPoint &pos, int ) if (keysList2->currentItem()->text(6).isEmpty()) popupgroup->exec(pos); else { - if ((keysList2->secretList.tqfind(sel->text(6))!=-1) && (keysList2->selectedItems().count()==1)) + if ((keysList2->secretList.find(sel->text(6))!=-1) && (keysList2->selectedItems().count()==1)) popupsec->exec(pos); else - if ((keysList2->orphanList.tqfind(sel->text(6))!=-1) && (keysList2->selectedItems().count()==1)) + if ((keysList2->orphanList.find(sel->text(6))!=-1) && (keysList2->selectedItems().count()==1)) popuporphan->exec(pos); else popup->exec(pos); @@ -1730,7 +1730,7 @@ void listKeys::createNewGroup() TQStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); KGpgSettings::setGroups(groups.join(",")); keysList2->refreshgroups(); - TQListViewItem *newgrp = keysList2->tqfindItem(groupName,0); + TQListViewItem *newgrp = keysList2->findItem(groupName,0); keysList2->clearSelection(); keysList2->setCurrentItem(newgrp); @@ -2232,7 +2232,7 @@ void listKeys::readgenprocess(KProcIO *p) { TQString required; while (p->readln(required,true)!=-1) { - if (required.tqfind("KEY_CREATED")!=-1) + if (required.find("KEY_CREATED")!=-1) newkeyFinger=required.stripWhiteSpace().section(' ',-1); message+=required+"\n"; } @@ -2299,7 +2299,7 @@ void listKeys::newKeyDone(KProcess *) delete pop; keyCreated->exec(); - TQListViewItem *newdef = keysList2->tqfindItem(newkeyID,6); + TQListViewItem *newdef = keysList2->findItem(newkeyID,6); if (newdef) if (page->CBdefault->isChecked()) slotSetDefaultKey(newdef); @@ -2388,7 +2388,7 @@ void listKeys::confirmdeletekey() deleteGroup(); return; } - if (((keysList2->secretList.tqfind(keysList2->currentItem()->text(6))!=-1) || (keysList2->orphanList.tqfind(keysList2->currentItem()->text(6))!=-1)) && (keysList2->selectedItems().count()==1)) + if (((keysList2->secretList.find(keysList2->currentItem()->text(6))!=-1) || (keysList2->orphanList.find(keysList2->currentItem()->text(6))!=-1)) && (keysList2->selectedItems().count()==1)) deleteseckey(); else { TQStringList keysToDelete; @@ -2397,7 +2397,7 @@ void listKeys::confirmdeletekey() bool secretKeyInside=false; for ( uint i = 0; i < exportList.count(); ++i ) if ( exportList.at(i) ) { - if (keysList2->secretList.tqfind(exportList.at(i)->text(6))!=-1) { + if (keysList2->secretList.find(exportList.at(i)->text(6))!=-1) { secretKeyInside=true; secList+=exportList.at(i)->text(0)+" ("+exportList.at(i)->text(1)+")<br>"; exportList.at(i)->setSelected(false); @@ -2718,14 +2718,14 @@ void KeyView::refreshkeylist() TQStringList::Iterator ite; - ite=issec.tqfind(pubKey.gpgkeyid.right(8)); + ite=issec.find(pubKey.gpgkeyid.right(8)); if (ite!=issec.end()) { item->setPixmap(0,pixkeyPair); secretList+=pubKey.gpgkeyid; issec.remove(*ite); } else item->setPixmap(0,pixkeySingle); - if (openKeys.tqfind(pubKey.gpgkeyid)!=-1) + if (openKeys.find(pubKey.gpgkeyid)!=-1) item->setOpen(true); } @@ -2753,9 +2753,9 @@ void KeyView::refreshkeylist() if(current != NULL) { // select previous selected if (!current->text(6).isEmpty()) - newPos = tqfindItem(current->text(6), 6); + newPos = findItem(current->text(6), 6); else - newPos = tqfindItem(current->text(0), 0); + newPos = findItem(current->text(0), 0); delete current; } @@ -2816,7 +2816,7 @@ void KeyView::insertOrphanedKeys(TQStringList orphans) fp = popen("gpg --no-secmem-warning --no-tty --with-colons --list-secret-keys", "r"); while ( fgets( line, sizeof(line), fp)) { TQString lineRead=TQString::fromUtf8(line); - if ((lineRead.startsWith("sec")) && (orphans.tqfind(lineRead.section(':',4,4).right(8))!=orphans.end())) { + if ((lineRead.startsWith("sec")) && (orphans.find(lineRead.section(':',4,4).right(8))!=orphans.end())) { gpgKey orphanedKey=extractKey(lineRead); bool isbold=false; @@ -2881,7 +2881,7 @@ void KeyView::slotReloadKeys(TQStringList keyIDs) refreshcurrentkey(*it); } kdDebug(2100)<<"Refreshing key:--------"<<TQString((keyIDs.last()).right(8).prepend("0x"))<<endl; - ensureItemVisible(this->tqfindItem((keyIDs.last()).right(8).prepend("0x"),6)); + ensureItemVisible(this->findItem((keyIDs.last()).right(8).prepend("0x"),6)); emit statusMessage(i18n("%1 Keys, %2 Groups").tqarg(childCount()-groupNb).tqarg(groupNb),1); emit statusMessage(i18n("Ready"),0); } @@ -2911,12 +2911,12 @@ void KeyView::slotReloadOrphaned() TQStringList::Iterator it; for ( it = issec.begin(); it != issec.end(); ++it ) { - if (tqfindItem(*it,6)==0) { + if (findItem(*it,6)==0) { insertOrphan(*it); orphanList+=*it+","; } } - setSelected(tqfindItem(*it,6),true); + setSelected(findItem(*it,6),true); emit statusMessage(i18n("%1 Keys, %2 Groups").tqarg(childCount()-groupNb).tqarg(groupNb),1); emit statusMessage(i18n("Ready"),0); } @@ -2958,7 +2958,7 @@ void KeyView::refreshcurrentkey(TQString currentID) item->setPixmap(2,pubKey.trustpic); item->setVisible(true); item->setExpandable(true); - if (issec.tqfind(pubKey.gpgkeyid.right(8),0,FALSE)!=-1) { + if (issec.find(pubKey.gpgkeyid.right(8),0,FALSE)!=-1) { item->setPixmap(0,pixkeyPair); secretList+=pubKey.gpgkeyid; } else { @@ -2969,12 +2969,12 @@ void KeyView::refreshcurrentkey(TQString currentID) pclose(fp); if (!keyFound) { - if (orphanList.tqfind(currentID)==-1) + if (orphanList.find(currentID)==-1) orphanList+=currentID+","; insertOrphan(currentID); return; } - if (orphanList.tqfind(currentID)!=-1) + if (orphanList.find(currentID)!=-1) orphanList.remove(currentID); clearSelection(); @@ -3059,7 +3059,7 @@ gpgKey KeyView::extractKey(TQString keyColon) ret.gpgkeyexpiration=KGlobal::locale()->formatDate(date, true); } TQString fullname=keyString[9]; - if (fullname.tqfind("<")!=-1) { + if (fullname.find("<")!=-1) { ret.gpgkeymail=fullname.section('<',-1,-1); ret.gpgkeymail.truncate(ret.gpgkeymail.length()-1); ret.gpgkeyname=fullname.section('<',0,0); @@ -3138,7 +3138,7 @@ gpgKey KeyView::extractKey(TQString keyColon) ret.trustpic=trustunknown; break; } - if (keyString[11].tqfind('D')!=-1) { + if (keyString[11].find('D')!=-1) { ret.gpgkeytrust=i18n("Disabled"); ret.trustpic=trustbad; } diff --git a/kgpg/popuppublic.cpp b/kgpg/popuppublic.cpp index 1ae2a01..20b651a 100644 --- a/kgpg/popuppublic.cpp +++ b/kgpg/popuppublic.cpp @@ -256,7 +256,7 @@ void popupPublic::sort() if (current==NULL) return; - if ((untrustedList.tqfind(current->text(2))!=untrustedList.end()) && (!current->text(2).isEmpty())){ + if ((untrustedList.find(current->text(2))!=untrustedList.end()) && (!current->text(2).isEmpty())){ if (current->isSelected()) { current->setSelected(false); reselect=true; @@ -266,7 +266,7 @@ void popupPublic::sort() while ( current->nextSibling() ) { current = current->nextSibling(); - if ((untrustedList.tqfind(current->text(2))!=untrustedList.end()) && (!current->text(2).isEmpty())) { + if ((untrustedList.find(current->text(2))!=untrustedList.end()) && (!current->text(2).isEmpty())) { if (current->isSelected()) { current->setSelected(false); reselect=true; @@ -304,7 +304,7 @@ void popupPublic::customOpts(const TQString &str) void popupPublic::slotGotoDefaultKey() { - TQListViewItem *myDefaulKey = keysList->tqfindItem(KGpgSettings::defaultKey(),2); + TQListViewItem *myDefaulKey = keysList->findItem(KGpgSettings::defaultKey(),2); keysList->clearSelection(); keysList->setCurrentItem(myDefaulKey); keysList->setSelected(myDefaulKey,true); @@ -346,7 +346,7 @@ void popupPublic::slotpreselect() { TQListViewItem *it=NULL; if (!keysList->firstChild()) return; - if (fmode) it=keysList->tqfindItem(KGpgSettings::defaultKey(),2); + if (fmode) it=keysList->findItem(KGpgSettings::defaultKey(),2); if (!trusted) sort(); if (fmode) @@ -415,13 +415,13 @@ void popupPublic::slotprocread(KProcIO *p) untrustedList<<id; break; } - if (keyString[11].tqfind('D')!=-1) dead=true; + if (keyString[11].find('D')!=-1) dead=true; tst=keyString[9]; - if (tst.tqfind("<")!=-1) { + if (tst.find("<")!=-1) { keymail=tst.section('<',-1,-1); keymail.truncate(keymail.length()-1); keyname=tst.section('<',0,0); - //if (keyname.tqfind("(")!=-1) + //if (keyname.find("(")!=-1) // keyname=keyname.section('(',0,0); } else { keymail=TQString(); @@ -433,7 +433,7 @@ void popupPublic::slotprocread(KProcIO *p) UpdateViewItem2 *item=new UpdateViewItem2(keysList,keyname,keymail,id,isDefaultKey); //KListViewItem *sub= new KListViewItem(item,i18n("ID: %1, trust: %2, validity: %3").tqarg(id).tqarg(tr).tqarg(val)); //sub->setSelectable(false); - if (seclist.tqfind(tst,0,FALSE)!=-1) + if (seclist.find(tst,0,FALSE)!=-1) item->setPixmap(0,keyPair); else item->setPixmap(0,keySingle); |