From 4c6f8d69e2d1501837affb472c4eb8fec4462240 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 10 Aug 2011 06:08:18 +0000 Subject: rename the following methods: tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkpgp/kpgpbase5.cpp | 90 +++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'libkpgp/kpgpbase5.cpp') diff --git a/libkpgp/kpgpbase5.cpp b/libkpgp/kpgpbase5.cpp index 46ded2c73..288957399 100644 --- a/libkpgp/kpgpbase5.cpp +++ b/libkpgp/kpgpbase5.cpp @@ -112,7 +112,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients, if (signonly) { input.append("\n"); - input.tqreplace(TQRegExp("[ \t]+\n"), "\n"); //strip trailing whitespace + input.replace(TQRegExp("[ \t]+\n"), "\n"); //strip trailing whitespace } //We have to do this otherwise it's all in vain @@ -123,7 +123,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients, status = ERROR; // now parse the returned info - if(error.tqfind("Cannot unlock private key") != -1) + if(error.find("Cannot unlock private key") != -1) { errMsg = i18n("The passphrase you entered is invalid."); status |= ERROR; @@ -133,16 +133,16 @@ Base5::encsign( Block& block, const KeyIDList& recipients, //{ TQCString aStr; index = -1; - while((index = error.tqfind("WARNING: The above key",index+1)) != -1) + while((index = error.find("WARNING: The above key",index+1)) != -1) { - int index2 = error.tqfind("But you previously",index); - int index3 = error.tqfind("WARNING: The above key",index+1); + int index2 = error.find("But you previously",index); + int index3 = error.find("WARNING: The above key",index+1); if(index2 == -1 || (index2 > index3 && index3 != -1)) { // the key wasn't valid, no encryption to this person // extract the person - index2 = error.tqfind('\n',index); - index3 = error.tqfind('\n',index2+1); + index2 = error.find('\n',index); + index3 = error.find('\n',index2+1); aStr += error.mid(index2+1, index3-index2-1); aStr += ", "; } @@ -150,7 +150,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients, if(!aStr.isEmpty()) { aStr.truncate(aStr.length()-2); - if(error.tqfind("No valid keys found") != -1) + if(error.find("No valid keys found") != -1) errMsg = i18n("The key(s) you want to encrypt your message " "to are not trusted. No encryption done."); else @@ -161,10 +161,10 @@ Base5::encsign( Block& block, const KeyIDList& recipients, status |= BADKEYS; } //} - if((index = error.tqfind("No encryption keys found for")) != -1) + if((index = error.find("No encryption keys found for")) != -1) { - index = error.tqfind(':',index); - int index2 = error.tqfind('\n',index); + index = error.find(':',index); + int index2 = error.find('\n',index); errMsg = i18n("Missing encryption key(s) for:\n%1") .tqarg(TQString(error.mid(index,index2-index))); @@ -178,8 +178,8 @@ Base5::encsign( Block& block, const KeyIDList& recipients, // dash-escape the input if (input[0] == '-') input = "- " + input; - for ( int idx = 0 ; (idx = input.tqfind("\n-", idx)) >= 0 ; idx += 4 ) - input.tqreplace(idx, 2, "\n- -"); + for ( int idx = 0 ; (idx = input.find("\n-", idx)) >= 0 ; idx += 4 ) + input.replace(idx, 2, "\n- -"); output = "-----BEGIN PGP SIGNED MESSAGE-----\n\n" + input + "\n" + output; } @@ -212,7 +212,7 @@ Base5::decrypt( Block& block, const char *passphrase ) // lets parse the returned information. int index; - index = error.tqfind("Cannot decrypt message"); + index = error.find("Cannot decrypt message"); if(index != -1) { //kdDebug(5100) << "message is encrypted" << endl; @@ -220,7 +220,7 @@ Base5::decrypt( Block& block, const char *passphrase ) // ok. we have an encrypted message. Is the passphrase bad, // or do we not have the secret key? - if(error.tqfind("Need a pass phrase") != -1) + if(error.find("Need a pass phrase") != -1) { if(passphrase != 0) { @@ -242,15 +242,15 @@ Base5::decrypt( Block& block, const char *passphrase ) #if 0 // ##### FIXME: This information is anyway currently not used // I'll change it to always determine the recipients. - index = error.tqfind("can only be decrypted by:"); + index = error.find("can only be decrypted by:"); if(index != -1) { - index = error.tqfind('\n',index); - int end = error.tqfind("\n\n",index); + index = error.find('\n',index); + int end = error.find("\n\n",index); mRecipients.clear(); int index2; - while( (index2 = error.tqfind('\n',index+1)) <= end ) + while( (index2 = error.find('\n',index+1)) <= end ) { TQCString item = error.mid(index+1,index2-index-1); item.stripWhiteSpace(); @@ -260,7 +260,7 @@ Base5::decrypt( Block& block, const char *passphrase ) } #endif } - index = error.tqfind("Good signature"); + index = error.find("Good signature"); if(index != -1) { //kdDebug(5100) << "good signature" << endl; @@ -268,18 +268,18 @@ Base5::decrypt( Block& block, const char *passphrase ) status |= GOODSIG; // get key ID of signer - index = error.tqfind("Key ID ", index) + 7; + index = error.find("Key ID ", index) + 7; block.setSignatureKeyId( error.mid(index, 8) ); // get signer - index = error.tqfind('"',index) + 1; - int index2 = error.tqfind('"', index); + index = error.find('"',index) + 1; + int index2 = error.find('"', index); block.setSignatureUserId( error.mid(index, index2-index) ); /// ### FIXME get signature date block.setSignatureDate( "" ); } - index = error.tqfind("BAD signature"); + index = error.find("BAD signature"); if(index != -1) { //kdDebug(5100) << "BAD signature" << endl; @@ -287,21 +287,21 @@ Base5::decrypt( Block& block, const char *passphrase ) status |= ERROR; // get key ID of signer - index = error.tqfind("Key ID ", index) + 7; + index = error.find("Key ID ", index) + 7; block.setSignatureKeyId( error.mid(index, 8) ); // get signer - index = error.tqfind('"',index) + 1; - int index2 = error.tqfind('"', index); + index = error.find('"',index) + 1; + int index2 = error.find('"', index); block.setSignatureUserId( error.mid(index, index2-index) ); /// ### FIXME get signature date block.setSignatureDate( "" ); } - index = error.tqfind("Signature by unknown key"); + index = error.find("Signature by unknown key"); if(index != -1) { - index = error.tqfind("keyid: 0x",index) + 9; + index = error.find("keyid: 0x",index) + 9; block.setSignatureKeyId( error.mid(index, 8) ); block.setSignatureUserId( TQString() ); // FIXME: not a very good solution... @@ -483,7 +483,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ ) int eol; // search the end of the current line - eol = output.tqfind( '\n', offset ); + eol = output.find( '\n', offset ); if( ( eol == -1 ) || ( eol == offset ) ) break; @@ -525,7 +525,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ ) pos = offset + 4; while( output[pos] == ' ' ) pos++; - pos2 = output.tqfind( ' ', pos ); + pos2 = output.find( ' ', pos ); subkey->setKeyLength( output.mid( pos, pos2-pos ).toUInt() ); //kdDebug(5100) << "Key Length: "<keyLength()<setKeyID( output.mid( pos, pos2-pos ) ); //kdDebug(5100) << "Key ID: "<keyID()<setExpirationDate( -1 ); @@ -595,7 +595,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ ) pos = pos2 + 1; while( output[pos] == ' ' ) pos++; - pos2 = output.tqfind( ' ', pos ); + pos2 = output.find( ' ', pos ); if( !strncmp( output.data() + pos, "RSA", 3 ) ) { sign = true; @@ -653,11 +653,11 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ ) f20 Fingerprint20 = 226F 4B63 6DA2 7389 91D1 2A49 D58A 3EC1 5214 181E */ - int pos = output.tqfind( '=', offset+3 ) + 2; + int pos = output.find( '=', offset+3 ) + 2; TQCString fingerprint = output.mid( pos, eol-pos ); // remove white space from the fingerprint - for ( int idx = 0 ; (idx = fingerprint.tqfind(' ', idx)) >= 0 ; ) - fingerprint.tqreplace( idx, 1, "" ); + for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; ) + fingerprint.replace( idx, 1, "" ); assert( subkey != 0 ); subkey->setFingerprint( fingerprint ); //kdDebug(5100)<<"Fingerprint: "<userIDs(); // search the start of the trust data - int offset = str.tqfind( "\n\n KeyID" ) + 9; + int offset = str.find( "\n\n KeyID" ) + 9; if( offset == -1 + 9 ) return; - offset = str.tqfind( '\n', offset ) + 1; + offset = str.find( '\n', offset ) + 1; if( offset == -1 + 1 ) return; @@ -788,7 +788,7 @@ Base5::parseTrustDataForKey( Key* key, const TQCString& str ) int eol; // search the end of the current line - if( ( eol = str.tqfind( '\n', offset ) ) == -1 ) + if( ( eol = str.find( '\n', offset ) ) == -1 ) break; if( str[offset+23] != ' ' ) -- cgit v1.2.1