summaryrefslogtreecommitdiffstats
path: root/kmail/kmmessage.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
commitf4fae92b6768541e2952173c3d4b09040f95bf7e (patch)
treed8c5d93232235cd635f3310b4d95490df181ba2d /kmail/kmmessage.cpp
parent125c0a08265b75a133644d3b55f47e37c919f45d (diff)
downloadtdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.tar.gz
tdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.zip
Moved kpilot from kdepim to applications, as the core Trinity libraries should not contain hardware-dependent software
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1221127 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmmessage.cpp')
-rw-r--r--kmail/kmmessage.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/kmail/kmmessage.cpp b/kmail/kmmessage.cpp
index 6819d68d9..3af9a252a 100644
--- a/kmail/kmmessage.cpp
+++ b/kmail/kmmessage.cpp
@@ -246,7 +246,7 @@ bool KMMessage::transferInProgress() const
void KMMessage::setTransferInProgress(bool value, bool force)
{
MessageProperty::setTransferInProgress( getMsgSerNum(), value, force );
- if ( !transferInProgress() && sPendingDeletes.contains( this ) ) {
+ if ( !transferInProgress() && sPendingDeletes.tqcontains( this ) ) {
sPendingDeletes.remove( this );
if ( parent() ) {
int idx = parent()->find( this );
@@ -260,7 +260,7 @@ void KMMessage::setTransferInProgress(bool value, bool force)
bool KMMessage::isUrgent() const {
- return headerField( "Priority" ).contains( "urgent", false )
+ return headerField( "Priority" ).tqcontains( "urgent", false )
|| headerField( "X-Priority" ).startsWith( "2" );
}
@@ -351,7 +351,7 @@ void KMMessage::removePrivateHeaderFields() {
}
//-----------------------------------------------------------------------------
-void KMMessage::setStatusFields()
+void KMMessage::seStatusFields()
{
char str[2] = { 0, 0 };
@@ -384,7 +384,7 @@ TQString KMMessage::headerAsString() const
header.Assemble();
if ( header.AsString().empty() )
return TQString::null;
- return TQString::fromLatin1( header.AsString().c_str() );
+ return TQString::tqfromLatin1( header.AsString().c_str() );
}
@@ -394,23 +394,23 @@ DwMediaType& KMMessage::dwContentType()
return mMsg->Headers().ContentType();
}
-void KMMessage::fromByteArray( const TQByteArray & ba, bool setStatus ) {
- return fromDwString( DwString( ba.data(), ba.size() ), setStatus );
+void KMMessage::fromByteArray( const TQByteArray & ba, bool seStatus ) {
+ return fromDwString( DwString( ba.data(), ba.size() ), seStatus );
}
-void KMMessage::fromString( const TQCString & str, bool aSetStatus ) {
- return fromDwString( KMail::Util::dwString( str ), aSetStatus );
+void KMMessage::fromString( const TQCString & str, bool aSeStatus ) {
+ return fromDwString( KMail::Util::dwString( str ), aSeStatus );
}
-void KMMessage::fromDwString(const DwString& str, bool aSetStatus)
+void KMMessage::fromDwString(const DwString& str, bool aSeStatus)
{
delete mMsg;
mMsg = new DwMessage;
mMsg->FromString( str );
mMsg->Parse();
- if (aSetStatus) {
- setStatus(headerField("Status").latin1(), headerField("X-Status").latin1());
+ if (aSeStatus) {
+ seStatus(headerField("Status").latin1(), headerField("X-Status").latin1());
setEncryptionStateChar( headerField("X-KMail-EncryptionState").at(0) );
setSignatureStateChar( headerField("X-KMail-SignatureState").at(0) );
setMDNSentState( static_cast<KMMsgMDNSentState>( headerField("X-KMail-MDN-Sent").at(0).latin1() ) );
@@ -852,7 +852,7 @@ TQString KMMessage::asQuotedString( const TQString& aHeaderStr,
const TQString indentStr = formatString( aIndentStr );
- content.replace( '\n', '\n' + indentStr );
+ content.tqreplace( '\n', '\n' + indentStr );
content.prepend( indentStr );
content += '\n';
@@ -916,7 +916,7 @@ KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy,
// strip all my addresses from the list of recipients
TQStringList recipients = KPIM::splitEmailAddrList( toStr );
toStr = stripMyAddressesFromAddressList( recipients ).join(", ");
- // ... unless the list contains only my addresses (reply to self)
+ // ... unless the list tqcontains only my addresses (reply to self)
if ( toStr.isEmpty() && !recipients.isEmpty() )
toStr = recipients[0];
@@ -1081,7 +1081,7 @@ KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy,
parser.process( this );
}
}
- // setStatus(KMMsgStatusReplied);
+ // seStatus(KMMsgStatusReplied);
msg->link(this, KMMsgStatusReplied);
if ( parent() && parent()->putRepliesInSameFolder() )
@@ -1216,7 +1216,7 @@ void KMMessage::sanitizeHeaders( const TQStringList& whiteList )
{
nextField = field->Next();
if ( field->FieldNameStr().find( "ontent" ) == DwString::npos
- && !whiteList.contains( TQString::fromLatin1( field->FieldNameStr().c_str() ) ) )
+ && !whiteList.tqcontains( TQString::tqfromLatin1( field->FieldNameStr().c_str() ) ) )
header.RemoveField(field);
field = nextField;
}
@@ -1276,7 +1276,7 @@ KMMessage* KMMessage::createForward( const TQString &tmpl /* = TQString::null */
msg->initFromMessage( this );
msg->removeHeaderField("Content-Type");
msg->removeHeaderField("Content-Transfer-Encoding");
- // Modify the ContentType directly (replaces setAutomaticFields(true))
+ // Modify the ContentType directly (tqreplaces setAutomaticFields(true))
DwHeaders & header = msg->mMsg->Headers();
header.MimeVersion().FromString("1.0");
DwMediaType & contentType = msg->dwContentType();
@@ -1328,32 +1328,32 @@ static const struct {
const char * text;
} mdnMessageBoxes[] = {
{ "mdnNormalAsk", true,
- I18N_NOOP("This message contains a request to return a notification "
+ I18N_NOOP("This message tqcontains a request to return a notification "
"about your reception of the message.\n"
"You can either ignore the request or let KMail send a "
"\"denied\" or normal response.") },
{ "mdnUnknownOption", false,
- I18N_NOOP("This message contains a request to send a notification "
+ I18N_NOOP("This message tqcontains a request to send a notification "
"about your reception of the message.\n"
- "It contains a processing instruction that is marked as "
+ "It tqcontains a processing instruction that is marked as "
"\"required\", but which is unknown to KMail.\n"
"You can either ignore the request or let KMail send a "
"\"failed\" response.") },
{ "mdnMultipleAddressesInReceiptTo", true,
- I18N_NOOP("This message contains a request to send a notification "
+ I18N_NOOP("This message tqcontains a request to send a notification "
"about your reception of the message,\n"
"but it is requested to send the notification to more "
"than one address.\n"
"You can either ignore the request or let KMail send a "
"\"denied\" or normal response.") },
{ "mdnReturnPathEmpty", true,
- I18N_NOOP("This message contains a request to send a notification "
+ I18N_NOOP("This message tqcontains a request to send a notification "
"about your reception of the message,\n"
"but there is no return-path set.\n"
"You can either ignore the request or let KMail send a "
"\"denied\" or normal response.") },
{ "mdnReturnPathNotInReceiptTo", true,
- I18N_NOOP("This message contains a request to send a notification "
+ I18N_NOOP("This message tqcontains a request to send a notification "
"about your reception of the message,\n"
"but the return-path address differs from the address "
"the notification was requested to be sent to.\n"
@@ -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.contains( "required", false ) ) {
+ if ( notificationOptions.tqcontains( "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::null
: returnPathList.front().localPart + '@' + returnPathList.front().domain ;
kdDebug(5006) << "clean return path: " << returnPath << endl;
- if ( returnPath.isEmpty() || !receiptTo.contains( returnPath, false ) ) {
+ if ( returnPath.isEmpty() || !receiptTo.tqcontains( returnPath, false ) ) {
if ( !allowGUI ) return 0; // don't setMDNSentState here!
mode = requestAdviceOnMDN( returnPath.isEmpty() ?
"mdnReturnPathEmpty" :
@@ -1523,7 +1523,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
receipt->initFromMessage( this );
receipt->removeHeaderField("Content-Type");
receipt->removeHeaderField("Content-Transfer-Encoding");
- // Modify the ContentType directly (replaces setAutomaticFields(true))
+ // Modify the ContentType directly (tqreplaces setAutomaticFields(true))
DwHeaders & header = receipt->mMsg->Headers();
header.MimeVersion().FromString("1.0");
DwMediaType & contentType = receipt->dwContentType();
@@ -1533,7 +1533,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
receipt->mNeedsAssembly = true;
receipt->setContentTypeParam( "report-type", "disposition-notification" );
- TQString description = replaceHeadersInString( MDN::descriptionFor( d, m ) );
+ TQString description = tqreplaceHeadersInString( MDN::descriptionFor( d, m ) );
// text/plain part:
KMMessagePart firstMsgPart;
@@ -1605,7 +1605,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
return receipt;
}
-TQString KMMessage::replaceHeadersInString( const TQString & s ) const {
+TQString KMMessage::tqreplaceHeadersInString( const TQString & s ) const {
TQString result = s;
TQRegExp rx( "\\$\\{([a-z0-9-]+)\\}", false );
Q_ASSERT( rx.isValid() );
@@ -1618,14 +1618,14 @@ TQString KMMessage::replaceHeadersInString( const TQString & s ) const {
int idx = 0;
if( ( idx = rxDate.search( result, idx ) ) != -1 ) {
- result.replace( idx, rxDate.matchedLength(), sDate );
+ result.tqreplace( idx, rxDate.matchedLength(), sDate );
}
idx = 0;
while ( ( idx = rx.search( result, idx ) ) != -1 ) {
- TQString replacement = headerField( rx.cap(1).latin1() );
- result.replace( idx, rx.matchedLength(), replacement );
- idx += replacement.length();
+ TQString tqreplacement = headerField( rx.cap(1).latin1() );
+ result.tqreplace( idx, rx.matchedLength(), tqreplacement );
+ idx += tqreplacement.length();
}
return result;
}
@@ -2144,7 +2144,7 @@ TQString KMMessage::references() const
TQString KMMessage::replyToAuxIdMD5() const
{
TQString result = references();
- // references contains two items, use the first one
+ // references tqcontains two items, use the first one
// (the second to last reference)
const int rightAngle = result.find( '>' );
if( rightAngle != -1 )
@@ -2666,7 +2666,7 @@ TQValueList<int> KMMessage::determineAllowedCtes( const CharFreq& cf,
}
// In the following cases only QP and Base64 are allowed:
- // - the buffer will be OpenPGP/MIME signed and it contains trailing
+ // - the buffer will be OpenPGP/MIME signed and it tqcontains trailing
// whitespace (cf. RFC 3156)
// - a line starts with "From "
if ( ( willBeSigned && cf.hasTrailingWhitespace() ) ||
@@ -2819,7 +2819,7 @@ int KMMessage::numBodyParts() const
parts.append( part );
part = part->Body().FirstBodyPart();
}
- // this is where currPart->msgPart contains a leaf message part
+ // this is where currPart->msgPart tqcontains a leaf message part
count++;
// go up in the tree until reaching a node with next
// (or the last top-level node)
@@ -2871,7 +2871,7 @@ int KMMessage::partNumber( DwBodyPart * aDwBodyPart ) const
parts.append( curpart );
curpart = curpart->Body().FirstBodyPart();
}
- // this is where currPart->msgPart contains a leaf message part
+ // this is where currPart->msgPart tqcontains a leaf message part
if (curpart == aDwBodyPart)
idx = curIdx;
curIdx++;
@@ -2911,7 +2911,7 @@ DwBodyPart * KMMessage::dwBodyPart( int aIdx ) const
parts.append( curpart );
curpart = curpart->Body().FirstBodyPart();
}
- // this is where currPart->msgPart contains a leaf message part
+ // this is where currPart->msgPart tqcontains a leaf message part
if (curIdx==aIdx)
part = curpart;
curIdx++;
@@ -2949,7 +2949,7 @@ DwBodyPart * KMMessage::findDwBodyPart( int type, int subtype ) const
parts.append( curpart );
curpart = curpart->Body().FirstBodyPart();
}
- // this is where curPart->msgPart contains a leaf message part
+ // this is where curPart->msgPart tqcontains a leaf message part
// pending(khz): Find out WHY this look does not travel down *into* an
// embedded "Message/RfF822" message containing a "Multipart/Mixed"
@@ -2998,7 +2998,7 @@ DwBodyPart * KMMessage::findDwBodyPart( const TQCString& type, const TQCString&
parts.append( curpart );
curpart = curpart->Body().FirstBodyPart();
}
- // this is where curPart->msgPart contains a leaf message part
+ // this is where curPart->msgPart tqcontains a leaf message part
// pending(khz): Find out WHY this look does not travel down *into* an
// embedded "Message/RfF822" message containing a "Multipart/Mixed"
@@ -3198,7 +3198,7 @@ bool KMMessage::deleteBodyPart( int partIndex )
dummyPart.setBodyEncodedBinary( TQByteArray() );
TQCString cd = dummyPart.contentDisposition();
if ( cd.find( "inline", 0, false ) == 0 ) {
- cd.replace( 0, 10, "attachment" );
+ cd.tqreplace( 0, 10, "attachment" );
dummyPart.setContentDisposition( cd );
} else if ( cd.isEmpty() ) {
dummyPart.setContentDisposition( "attachment" );
@@ -3358,7 +3358,7 @@ void KMMessage::addBodyPart(const KMMessagePart* aPart)
//-----------------------------------------------------------------------------
TQString KMMessage::generateMessageId( const TQString& addr )
{
- TQDateTime datetime = TQDateTime::currentDateTime();
+ TQDateTime datetime = TQDateTime::tqcurrentDateTime();
TQString msgIdStr;
msgIdStr = '<' + datetime.toString( "yyyyMMddhhmm.sszzz" );
@@ -3457,7 +3457,7 @@ TQCString KMMessage::html2source( const TQCString & src )
TQString KMMessage::encodeMailtoUrl( const TQString& str )
{
TQString result;
- result = TQString::fromLatin1( KMMsgBase::encodeRFC2047String( str,
+ result = TQString::tqfromLatin1( KMMsgBase::encodeRFC2047String( str,
"utf-8" ) );
result = KURL::encode_string( result );
return result;
@@ -4015,7 +4015,7 @@ TQString KMMessage::guessEmailAddressFromLoginName( const TQString& loginName )
if ( user.isValid() ) {
TQString fullName = user.fullName();
if ( fullName.find( TQRegExp( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ) ) != -1 )
- address = '"' + fullName.replace( '\\', "\\" ).replace( '"', "\\" )
+ address = '"' + fullName.tqreplace( '\\', "\\" ).tqreplace( '"', "\\" )
+ "\" <" + address + '>';
else
address = fullName + " <" + address + '>';
@@ -4145,11 +4145,11 @@ void KMMessage::setCharset( const TQCString &charset, DwEntity *entity )
//-----------------------------------------------------------------------------
-void KMMessage::setStatus(const KMMsgStatus aStatus, int idx)
+void KMMessage::seStatus(const KMMsgStatus aStatus, int idx)
{
if (mStatus == aStatus)
return;
- KMMsgBase::setStatus(aStatus, idx);
+ KMMsgBase::seStatus(aStatus, idx);
}
void KMMessage::setEncryptionState(const KMMsgEncryptionState s, int idx)
@@ -4208,10 +4208,10 @@ void KMMessage::link( const KMMessage *aMsg, KMMsgStatus aStatus )
}
//-----------------------------------------------------------------------------
-void KMMessage::getLink(int n, ulong *retMsgSerNum, KMMsgStatus *retStatus) const
+void KMMessage::getLink(int n, ulong *retMsgSerNum, KMMsgStatus *reStatus) const
{
*retMsgSerNum = 0;
- *retStatus = KMMsgStatusUnknown;
+ *reStatus = KMMsgStatusUnknown;
TQString message = headerField("X-KMail-Link-Message");
TQString type = headerField("X-KMail-Link-Type");
@@ -4221,11 +4221,11 @@ void KMMessage::getLink(int n, ulong *retMsgSerNum, KMMsgStatus *retStatus) cons
if ( !message.isEmpty() && !type.isEmpty() ) {
*retMsgSerNum = message.toULong();
if ( type == "reply" )
- *retStatus = KMMsgStatusReplied;
+ *reStatus = KMMsgStatusReplied;
else if ( type == "forward" )
- *retStatus = KMMsgStatusForwarded;
+ *reStatus = KMMsgStatusForwarded;
else if ( type == "deleted" )
- *retStatus = KMMsgStatusDeleted;
+ *reStatus = KMMsgStatusDeleted;
}
}
@@ -4347,11 +4347,11 @@ void KMMessage::updateInvitationState()
cntType += '/';
cntType += mMsg->Headers().ContentType().SubtypeStr().c_str();
if ( cntType.lower() == "text/calendar" ) {
- setStatus( KMMsgStatusHasInvitation );
+ seStatus( KMMsgStatusHasInvitation );
return;
}
}
- setStatus( KMMsgStatusHasNoInvitation );
+ seStatus( KMMsgStatusHasNoInvitation );
return;
}
@@ -4364,7 +4364,7 @@ void KMMessage::updateAttachmentState( DwBodyPart* part )
if ( !part )
{
// kdDebug(5006) << "updateAttachmentState - no part!" << endl;
- setStatus( KMMsgStatusHasNoAttach );
+ seStatus( KMMsgStatusHasNoAttach );
return;
}
@@ -4404,7 +4404,7 @@ void KMMessage::updateAttachmentState( DwBodyPart* part )
part->Headers().ContentType().Subtype() != DwMime::kSubtypePgpSignature &&
part->Headers().ContentType().Subtype() != DwMime::kSubtypePkcs7Signature ) )
{
- setStatus( KMMsgStatusHasAttach );
+ seStatus( KMMsgStatusHasAttach );
}
return;
}
@@ -4429,7 +4429,7 @@ void KMMessage::updateAttachmentState( DwBodyPart* part )
if ( part->Next() )
updateAttachmentState( part->Next() );
else if ( attachmentState() == KMMsgAttachmentUnknown )
- setStatus( KMMsgStatusHasNoAttach );
+ seStatus( KMMsgStatusHasNoAttach );
}
void KMMessage::setBodyFromUnicode( const TQString &str, DwEntity *entity )