diff options
Diffstat (limited to 'kmail/kmmessage.cpp')
-rw-r--r-- | kmail/kmmessage.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/kmail/kmmessage.cpp b/kmail/kmmessage.cpp index c083638d3..d4ef0ec49 100644 --- a/kmail/kmmessage.cpp +++ b/kmail/kmmessage.cpp @@ -246,10 +246,10 @@ bool KMMessage::transferInProgress() const void KMMessage::setTransferInProgress(bool value, bool force) { MessageProperty::setTransferInProgress( getMsgSerNum(), value, force ); - if ( !transferInProgress() && sPendingDeletes.tqcontains( this ) ) { + if ( !transferInProgress() && sPendingDeletes.contains( this ) ) { sPendingDeletes.remove( this ); if ( tqparent() ) { - int idx = tqparent()->tqfind( this ); + int idx = tqparent()->find( this ); if ( idx > 0 ) { tqparent()->removeMsg( idx ); } @@ -260,7 +260,7 @@ void KMMessage::setTransferInProgress(bool value, bool force) bool KMMessage::isUrgent() const { - return headerField( "Priority" ).tqcontains( "urgent", false ) + return headerField( "Priority" ).contains( "urgent", false ) || headerField( "X-Priority" ).startsWith( "2" ); } @@ -641,9 +641,9 @@ static bool flushPart(TQString &msg, TQStringList &part, static TQString stripSignature( const TQString & msg, bool clearSigned ) { if ( clearSigned ) - return msg.left( msg.tqfindRev( TQRegExp( "\n--\\s?\n" ) ) ); + return msg.left( msg.findRev( TQRegExp( "\n--\\s?\n" ) ) ); else - return msg.left( msg.tqfindRev( "\n-- \n" ) ); + return msg.left( msg.findRev( "\n-- \n" ) ); } TQString KMMessage::smartQuote( const TQString & msg, int maxLineLength ) @@ -845,14 +845,14 @@ TQString KMMessage::asQuotedString( const TQString& aHeaderStr, asPlainText( aStripSignature, allowDecryption ) : selection ; // Remove blank lines at the beginning: - const int firstNonWS = content.tqfind( TQRegExp( "\\S" ) ); - const int lineStart = content.tqfindRev( '\n', firstNonWS ); + const int firstNonWS = content.find( TQRegExp( "\\S" ) ); + const int lineStart = content.findRev( '\n', firstNonWS ); if ( lineStart >= 0 ) content.remove( 0, static_cast<unsigned int>( lineStart ) ); const TQString indentStr = formatString( aIndentStr ); - content.tqreplace( '\n', '\n' + indentStr ); + content.replace( '\n', '\n' + indentStr ); content.prepend( indentStr ); content += '\n'; @@ -887,7 +887,7 @@ KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy, !tqparent()->mailingListPostAddress().isEmpty() ) { mailingListAddresses << tqparent()->mailingListPostAddress(); } - if ( headerField("List-Post").tqfind( "mailto:", 0, false ) != -1 ) { + if ( headerField("List-Post").find( "mailto:", 0, false ) != -1 ) { TQString listPost = headerField("List-Post"); TQRegExp rx( "<mailto:([^@>]+)@([^>]+)>", false ); if ( rx.search( listPost, 0 ) != -1 ) // matched @@ -1108,14 +1108,14 @@ TQCString KMMessage::getRefStr() const if (refStr.isEmpty()) return headerField("Message-Id").latin1(); - i = refStr.tqfind('<'); - j = refStr.tqfind('>'); + i = refStr.find('<'); + j = refStr.find('>'); firstRef = refStr.mid(i, j-i+1); if (!firstRef.isEmpty()) retRefStr = firstRef + ' '; - i = refStr.tqfindRev('<'); - j = refStr.tqfindRev('>'); + i = refStr.findRev('<'); + j = refStr.findRev('>'); lastRef = refStr.mid(i, j-i+1); if (!lastRef.isEmpty() && lastRef != firstRef) @@ -1215,8 +1215,8 @@ void KMMessage::sanitizeHeaders( const TQStringList& whiteList ) while (field) { nextField = field->Next(); - if ( field->FieldNameStr().tqfind( "ontent" ) == DwString::npos - && !whiteList.tqcontains( TQString::tqfromLatin1( field->FieldNameStr().c_str() ) ) ) + if ( field->FieldNameStr().find( "ontent" ) == DwString::npos + && !whiteList.contains( TQString::tqfromLatin1( field->FieldNameStr().c_str() ) ) ) header.RemoveField(field); field = nextField; } @@ -1245,7 +1245,7 @@ KMMessage* KMMessage::createForward( const TQString &tmpl /* = TQString() */ ) TQStringList blacklist = GlobalSettings::self()->mimetypesToStripWhenInlineForwarding(); for ( TQStringList::Iterator it = blacklist.begin(); it != blacklist.end(); ++it ) { TQString entry = (*it); - int sep = entry.tqfind( '/' ); + int sep = entry.find( '/' ); TQCString type = entry.left( sep ).latin1(); TQCString subtype = entry.mid( sep+1 ).latin1(); kdDebug( 5006 ) << "Looking for blacklisted type: " << type << "/" << subtype << endl; @@ -1442,7 +1442,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a, // an MDN with any disposition type other than "failed" in response // to the request. TQString notificationOptions = headerField("Disposition-Notification-Options"); - if ( notificationOptions.tqcontains( "required", false ) ) { + if ( notificationOptions.contains( "required", false ) ) { // ### hacky; should parse... // There is a required option that we don't understand. We need to // ask the user what we should do: @@ -1476,7 +1476,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a, TQString returnPath = returnPathList.isEmpty() ? TQString() : returnPathList.front().localPart + '@' + returnPathList.front().domain ; kdDebug(5006) << "clean return path: " << returnPath << endl; - if ( returnPath.isEmpty() || !receiptTo.tqcontains( returnPath, false ) ) { + if ( returnPath.isEmpty() || !receiptTo.contains( returnPath, false ) ) { if ( !allowGUI ) return 0; // don't setMDNSentState here! mode = requestAdviceOnMDN( returnPath.isEmpty() ? "mdnReturnPathEmpty" : @@ -1618,13 +1618,13 @@ TQString KMMessage::replaceHeadersInString( const TQString & s ) const { int idx = 0; if( ( idx = rxDate.search( result, idx ) ) != -1 ) { - result.tqreplace( idx, rxDate.matchedLength(), sDate ); + result.replace( idx, rxDate.matchedLength(), sDate ); } idx = 0; while ( ( idx = rx.search( result, idx ) ) != -1 ) { TQString replacement = headerField( TQString(rx.cap(1)).latin1() ); - result.tqreplace( idx, rx.matchedLength(), replacement ); + result.replace( idx, rx.matchedLength(), replacement ); idx += replacement.length(); } return result; @@ -2081,11 +2081,11 @@ TQString KMMessage::replyToId() const replyTo = headerField("In-Reply-To"); // search the end of the (first) message id in the In-Reply-To header - rightAngle = replyTo.tqfind( '>' ); + rightAngle = replyTo.find( '>' ); if (rightAngle != -1) replyTo.truncate( rightAngle + 1 ); // now search the start of the message id - leftAngle = replyTo.tqfindRev( '<' ); + leftAngle = replyTo.findRev( '<' ); if (leftAngle != -1) replyTo = replyTo.mid( leftAngle ); @@ -2094,14 +2094,14 @@ TQString KMMessage::replyToId() const // misconfigured Mutt. They look like this <"from foo"@bar.baz>, i.e. // they contain double quotes and spaces. We only check for '"'. if (!replyTo.isEmpty() && (replyTo[0] == '<') && - ( -1 == replyTo.tqfind( '"' ) ) ) + ( -1 == replyTo.find( '"' ) ) ) return replyTo; references = headerField("References"); - leftAngle = references.tqfindRev( '<' ); + leftAngle = references.findRev( '<' ); if (leftAngle != -1) references = references.mid( leftAngle ); - rightAngle = references.tqfind( '>' ); + rightAngle = references.find( '>' ); if (rightAngle != -1) references.truncate( rightAngle + 1 ); @@ -2126,11 +2126,11 @@ TQString KMMessage::references() const TQString references = headerField( "References" ); // keep the last two entries for threading - leftAngle = references.tqfindRev( '<' ); - leftAngle = references.tqfindRev( '<', leftAngle - 1 ); + leftAngle = references.findRev( '<' ); + leftAngle = references.findRev( '<', leftAngle - 1 ); if( leftAngle != -1 ) references = references.mid( leftAngle ); - rightAngle = references.tqfindRev( '>' ); + rightAngle = references.findRev( '>' ); if( rightAngle != -1 ) references.truncate( rightAngle + 1 ); @@ -2146,7 +2146,7 @@ TQString KMMessage::replyToAuxIdMD5() const TQString result = references(); // references contains two items, use the first one // (the second to last reference) - const int rightAngle = result.tqfind( '>' ); + const int rightAngle = result.find( '>' ); if( rightAngle != -1 ) result.truncate( rightAngle + 1 ); @@ -2182,11 +2182,11 @@ TQString KMMessage::msgId() const TQString msgId = headerField("Message-Id"); // search the end of the message id - const int rightAngle = msgId.tqfind( '>' ); + const int rightAngle = msgId.find( '>' ); if (rightAngle != -1) msgId.truncate( rightAngle + 1 ); // now search the start of the message id - const int leftAngle = msgId.tqfindRev( '<' ); + const int leftAngle = msgId.findRev( '<' ); if (leftAngle != -1) msgId = msgId.mid( leftAngle ); return msgId; @@ -3197,8 +3197,8 @@ bool KMMessage::deleteBodyPart( int partIndex ) dummyPart.setContentDescription( comment ); dummyPart.setBodyEncodedBinary( TQByteArray() ); TQCString cd = dummyPart.contentDisposition(); - if ( cd.tqfind( "inline", 0, false ) == 0 ) { - cd.tqreplace( 0, 10, "attachment" ); + if ( cd.find( "inline", 0, false ) == 0 ) { + cd.replace( 0, 10, "attachment" ); dummyPart.setContentDisposition( cd ); } else if ( cd.isEmpty() ) { dummyPart.setContentDisposition( "attachment" ); @@ -3251,14 +3251,14 @@ DwBodyPart* KMMessage::createDWBodyPart(const KMMessagePart* aPart) int iL, i1, i2, iM; iL = additionalParam.length(); i1 = 0; - i2 = additionalParam.tqfind(';', i1, false); + i2 = additionalParam.find(';', i1, false); while ( i1 < iL ) { if( -1 == i2 ) i2 = iL; if( i1+1 < i2 ) { parAV = additionalParam.mid( i1, (i2-i1) ); - iM = parAV.tqfind('='); + iM = parAV.find('='); if( -1 < iM ) { parA = parAV.left( iM ).data(); @@ -3281,7 +3281,7 @@ DwBodyPart* KMMessage::createDWBodyPart(const KMMessagePart* aPart) ct.AddParameter( param ); } i1 = i2+1; - i2 = additionalParam.tqfind(';', i1, false); + i2 = additionalParam.find(';', i1, false); } } @@ -3975,7 +3975,7 @@ TQString KMMessage::expandAliases( const TQString& recipients ) // check whether the address is missing the domain part // FIXME: looking for '@' might be wrong - if ( receiver.tqfind('@') == -1 ) { + if ( receiver.find('@') == -1 ) { KConfigGroup general( KMKernel::config(), "General" ); TQString defaultdomain = general.readEntry( "Default domain" ); if( !defaultdomain.isEmpty() ) { @@ -4014,8 +4014,8 @@ TQString KMMessage::guessEmailAddressFromLoginName( const TQString& loginName ) const KUser user( loginName ); if ( user.isValid() ) { TQString fullName = user.fullName(); - if ( fullName.tqfind( TQRegExp( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ) ) != -1 ) - address = '"' + fullName.tqreplace( '\\', "\\" ).tqreplace( '"', "\\" ) + if ( fullName.find( TQRegExp( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ) ) != -1 ) + address = '"' + fullName.replace( '\\', "\\" ).replace( '"', "\\" ) + "\" <" + address + '>'; else address = fullName + " <" + address + '>'; |