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/kpgpbase6.cpp | 90 +++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'libkpgp/kpgpbase6.cpp') diff --git a/libkpgp/kpgpbase6.cpp b/libkpgp/kpgpbase6.cpp index 440ac6e2..0972a46e 100644 --- a/libkpgp/kpgpbase6.cpp +++ b/libkpgp/kpgpbase6.cpp @@ -66,15 +66,15 @@ Base6::decrypt( Block& block, const char *passphrase ) } // encrypted message - if( error.tqfind("File is encrypted.") != -1) + if( error.find("File is encrypted.") != -1) { //kdDebug(5100) << "kpgpbase: message is encrypted" << endl; status |= ENCRYPTED; - if((index = error.tqfind("Key for user ID")) != -1) + if((index = error.find("Key for user ID")) != -1) { // Find out the key for which the phrase is needed - index = error.tqfind(':', index) + 2; - index2 = error.tqfind('\n', index); + index = error.find(':', index) + 2; + index2 = error.find('\n', index); block.setRequiredUserId( error.mid(index, index2 - index) ); //kdDebug(5100) << "Base: key needed is \"" << block.requiredUserId() << "\"!\n"; @@ -90,7 +90,7 @@ Base6::decrypt( Block& block, const char *passphrase ) status |= ERROR; } } - else if( error.tqfind("You do not have the secret key needed to decrypt this file.") != -1) + else if( error.find("You do not have the secret key needed to decrypt this file.") != -1) { errMsg = i18n("You do not have the secret key for this message."); //kdDebug(5100) << "Base: no secret key for this message" << endl; @@ -123,46 +123,46 @@ Base6::decrypt( Block& block, const char *passphrase ) * File is signed. Good signature from user "Joe User ". * Signature made 2001/12/05 13:09 GMT */ - if(((index = error.tqfind("File is signed.")) != -1) - || (error.tqfind("Good signature") != -1 )) + if(((index = error.find("File is signed.")) != -1) + || (error.find("Good signature") != -1 )) { //kdDebug(5100) << "Base: message is signed" << endl; status |= SIGNED; // determine the signature date - if( ( index2 = error.tqfind( "Signature made", index ) ) != -1 ) + if( ( index2 = error.find( "Signature made", index ) ) != -1 ) { index2 += 15; - int eol = error.tqfind( '\n', index2 ); + int eol = error.find( '\n', index2 ); block.setSignatureDate( error.mid( index2, eol-index2 ) ); kdDebug(5100) << "Message was signed on '" << block.signatureDate() << "'\n"; } else block.setSignatureDate( TQCString() ); // determine signature status and signature key - if( error.tqfind("signature not checked") != -1) + if( error.find("signature not checked") != -1) { - index = error.tqfind("KeyID:",index); + index = error.find("KeyID:",index); block.setSignatureKeyId( error.mid(index+9,8) ); block.setSignatureUserId( TQString() ); status |= UNKNOWN_SIG; status |= GOODSIG; } - else if((index = error.tqfind("Good signature")) != -1 ) + else if((index = error.find("Good signature")) != -1 ) { status |= GOODSIG; // get signer - index = error.tqfind('"',index)+1; - index2 = error.tqfind('"', index); + index = error.find('"',index)+1; + index2 = error.find('"', index); block.setSignatureUserId( error.mid(index, index2-index) ); // get key ID of signer - index = error.tqfind("KeyID:",index2); + index = error.find("KeyID:",index2); if (index == -1) block.setSignatureKeyId( TQCString() ); else block.setSignatureKeyId( error.mid(index+9,8) ); } - else if( error.tqfind("Can't find the right public key") != -1 ) + else if( error.find("Can't find the right public key") != -1 ) { // #### fix this hack // #### This doesn't happen with PGP 6.5.8 because it seems to @@ -253,28 +253,28 @@ Base6::pubKeys() if (error.length() > 1) error.truncate(error.length()-1); TQStrList publicKeys; - index = error.tqfind("bits/keyID",1); // skip first to "\n" + index = error.find("bits/keyID",1); // skip first to "\n" if (index ==-1) { - index = error.tqfind("Type bits",1); // skip first to "\n" + index = error.find("Type bits",1); // skip first to "\n" if (index == -1) return 0; else compatibleMode = 0; } - while( (index = error.tqfind("\n",index)) != -1) + while( (index = error.find("\n",index)) != -1) { //parse line TQCString line; - if( (index2 = error.tqfind("\n",index+1)) != -1) + if( (index2 = error.find("\n",index+1)) != -1) // skip last line { int index3; if (compatibleMode) { - int index_pub = error.tqfind("pub ",index); - int index_sec = error.tqfind("sec ",index); + int index_pub = error.find("pub ",index); + int index_sec = error.find("sec ",index); if (index_pub < 0) index3 = index_sec; else if (index_sec < 0) @@ -284,8 +284,8 @@ Base6::pubKeys() } else { - int index_rsa = error.tqfind("RSA ",index); - int index_dss = error.tqfind("DSS ",index); + int index_rsa = error.find("RSA ",index); + int index_dss = error.find("DSS ",index); if (index_rsa < 0) index3 = index_dss; else if (index_dss < 0) @@ -301,14 +301,14 @@ Base6::pubKeys() line = line.stripWhiteSpace(); } else { // line with new key - int index4 = error.tqfind(TQRegExp("/\\d{2}/\\d{2} "), index); + int index4 = error.find(TQRegExp("/\\d{2}/\\d{2} "), index); line = error.mid(index4+7,index2-index4-7); } //kdDebug(5100) << "Base: found key for " << (const char *)line << endl; // don't add PGP's comments to the key list if (strncmp(line.data(),"*** KEY EXPIRED ***",19) && - line.tqfind(TQRegExp("^expires \\d{4}/\\d{2}/\\d{2}")) < 0 && + line.find(TQRegExp("^expires \\d{4}/\\d{2}/\\d{2}")) < 0 && strncmp(line.data(),"*** DEFAULT SIGNING KEY ***",27)) { publicKeys.append(line); } @@ -327,10 +327,10 @@ Base6::pubKeys() } index = 0; - while ( (index = error.tqfind("\n >", index)) != -1 ) { + while ( (index = error.find("\n >", index)) != -1 ) { TQCString line; index += 4; - index2 = error.tqfind(" \"", index); + index2 = error.find(" \"", index); line = error.mid(index, index2-index+1).stripWhiteSpace(); //kdDebug(5100) << "Base6: found key group for " << line << endl; @@ -362,7 +362,7 @@ Base6::isVersion6() return 0; } - if( error.tqfind("Version 6") != -1) + if( error.find("Version 6") != -1) { //kdDebug(5100) << "kpgpbase: pgp version 6.x detected" << endl; return 1; @@ -399,7 +399,7 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ ) int eol; // search the end of the current line - if( ( eol = output.tqfind( '\n', offset ) ) == -1 ) + if( ( eol = output.find( '\n', offset ) ) == -1 ) break; //kdDebug(5100) << "Parsing: " << output.mid(offset, eol-offset) << endl; @@ -465,7 +465,7 @@ Base6::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()<= 0 ; ) - fingerprint.tqreplace( idx, 1, "" ); + for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; ) + fingerprint.replace( idx, 1, "" ); //kdDebug(5100)<<"Fingerprint: "<userIDs(); // search the start of the trust data - int offset = str.tqfind( "\n\n KeyID" ); + int offset = str.find( "\n\n KeyID" ); if( offset == -1 ) return; - offset = str.tqfind( '\n', offset ) + 1; + offset = str.find( '\n', offset ) + 1; if( offset == 0 ) return; @@ -800,7 +800,7 @@ Base6::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.3