summaryrefslogtreecommitdiffstats
path: root/libkpgp/kpgpbase6.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commit4c6f8d69e2d1501837affb472c4eb8fec4462240 (patch)
tree766a8ad7939fcf3eec534184c36bd0e0f80489e2 /libkpgp/kpgpbase6.cpp
parent469cc56a805bd3d6940d54adbef554877c29853c (diff)
downloadtdepim-4c6f8d69e2d1501837affb472c4eb8fec4462240.tar.gz
tdepim-4c6f8d69e2d1501837affb472c4eb8fec4462240.zip
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
Diffstat (limited to 'libkpgp/kpgpbase6.cpp')
-rw-r--r--libkpgp/kpgpbase6.cpp90
1 files changed, 45 insertions, 45 deletions
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 <joe@foo.bar>".
* 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: "<<subkey->keyLength()<<endl;
@@ -474,7 +474,7 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
while( output[pos] == ' ' )
pos++;
pos += 2; // skip the '0x'
- pos2 = output.tqfind( ' ', pos );
+ pos2 = output.find( ' ', pos );
subkey->setKeyID( output.mid( pos, pos2-pos ) );
//kdDebug(5100) << "Key ID: "<<subkey->keyID()<<endl;
@@ -482,7 +482,7 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.tqfind( ' ', pos );
+ pos2 = output.find( ' ', pos );
int year = output.mid( pos, 4 ).toInt();
int month = output.mid( pos+5, 2 ).toInt();
int day = output.mid( pos+8, 2 ).toInt();
@@ -582,19 +582,19 @@ 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 );
// Key ID (ignored as it is anyway equal to the primary key id)
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.tqfind( ' ', pos );
+ pos2 = output.find( ' ', pos );
// Creation Date of secondary key (ignored)
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.tqfind( ' ', pos );
+ pos2 = output.find( ' ', pos );
// User ID or key properties
pos = pos2 + 1;
@@ -662,8 +662,8 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos += 18;
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, "" );
//kdDebug(5100)<<"Fingerprint: "<<fingerprint<<endl;
assert( subkey != 0 );
@@ -712,7 +712,7 @@ Base6::parseSingleKey( const TQCString& output, Key* key /* = 0 */ )
offset = 9;
else
{
- offset = output.tqfind( "\nType bits" );
+ offset = output.find( "\nType bits" );
if( offset == -1 )
return 0;
else
@@ -720,7 +720,7 @@ Base6::parseSingleKey( const TQCString& output, Key* key /* = 0 */ )
}
// key data begins in the next line
- offset = output.tqfind( '\n', offset ) + 1;
+ offset = output.find( '\n', offset ) + 1;
if( offset == 0 )
return 0;
@@ -745,13 +745,13 @@ Base6::parseKeyList( const TQCString& output, bool secretKeys )
offset = 0;
else
{
- offset = output.tqfind( "\nType bits" ) + 1;
+ offset = output.find( "\nType bits" ) + 1;
if( offset == 0 )
return keys;
}
// key data begins in the next line
- offset = output.tqfind( '\n', offset ) + 1;
+ offset = output.find( '\n', offset ) + 1;
if( offset == -1 )
return keys;
@@ -782,11 +782,11 @@ Base6::parseTrustDataForKey( Key* key, const TQCString& str )
UserIDList userIDs = key->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] != ' ' )