diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kmail/kmmessage.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmmessage.cpp')
-rw-r--r-- | kmail/kmmessage.cpp | 710 |
1 files changed, 355 insertions, 355 deletions
diff --git a/kmail/kmmessage.cpp b/kmail/kmmessage.cpp index 9c006b685..5a70afdb1 100644 --- a/kmail/kmmessage.cpp +++ b/kmail/kmmessage.cpp @@ -43,9 +43,9 @@ using KMail::HeaderStrategy; #include <kidna.h> #include <kasciistricmp.h> -#include <qcursor.h> -#include <qtextcodec.h> -#include <qmessagebox.h> +#include <tqcursor.h> +#include <tqtextcodec.h> +#include <tqmessagebox.h> #include <kmime_util.h> #include <kmime_charfreq.h> @@ -74,18 +74,18 @@ using namespace KMime; static DwString emptyString(""); // Values that are set from the config file with KMMessage::readConfig() -static QString sReplyLanguage, sReplyStr, sReplyAllStr, sIndentPrefixStr; +static TQString sReplyLanguage, sReplyStr, sReplyAllStr, sIndentPrefixStr; static bool sSmartQuote, sWordWrap; static int sWrapCol; -static QStringList sPrefCharsets; +static TQStringList sPrefCharsets; -QString KMMessage::sForwardStr; +TQString KMMessage::sForwardStr; const HeaderStrategy * KMMessage::sHeaderStrategy = HeaderStrategy::rich(); //helper static void applyHeadersToMessagePart( DwHeaders& headers, KMMessagePart* aPart ); -QValueList<KMMessage*> KMMessage::sPendingDeletes; +TQValueList<KMMessage*> KMMessage::sPendingDeletes; //----------------------------------------------------------------------------- KMMessage::KMMessage(DwMessage* aMsg) @@ -199,7 +199,7 @@ KMMessage::~KMMessage() //----------------------------------------------------------------------------- -void KMMessage::setReferences(const QCString& aStr) +void KMMessage::setReferences(const TQCString& aStr) { if (!aStr) return; mMsg->Headers().References().FromString(aStr); @@ -208,7 +208,7 @@ void KMMessage::setReferences(const QCString& aStr) //----------------------------------------------------------------------------- -QCString KMMessage::id() const +TQCString KMMessage::id() const { DwHeaders& header = mMsg->Headers(); if (header.HasMessageId()) @@ -273,15 +273,15 @@ void KMMessage::setUnencryptedMsg( KMMessage* unencrypted ) //----------------------------------------------------------------------------- //FIXME: move to libemailfunctions -KPIM::EmailParseResult KMMessage::isValidEmailAddressList( const QString& aStr, - QString& brokenAddress ) +KPIM::EmailParseResult KMMessage::isValidEmailAddressList( const TQString& aStr, + TQString& brokenAddress ) { if ( aStr.isEmpty() ) { return KPIM::AddressEmpty; } - QStringList list = KPIM::splitEmailAddrList( aStr ); - for( QStringList::const_iterator it = list.begin(); it != list.end(); ++it ) { + TQStringList list = KPIM::splitEmailAddrList( aStr ); + for( TQStringList::const_iterator it = list.begin(); it != list.end(); ++it ) { KPIM::EmailParseResult errorCode = KPIM::isValidEmailAddress( *it ); if ( errorCode != KPIM::AddressOk ) { brokenAddress = ( *it ); @@ -314,12 +314,12 @@ const DwMessage* KMMessage::asDwMessage() } //----------------------------------------------------------------------------- -QCString KMMessage::asString() const { +TQCString KMMessage::asString() const { return KMail::Util::CString( asDwString() ); } -QByteArray KMMessage::asSendableString() const +TQByteArray KMMessage::asSendableString() const { KMMessage msg( new DwMessage( *this->mMsg ) ); msg.removePrivateHeaderFields(); @@ -327,7 +327,7 @@ QByteArray KMMessage::asSendableString() const return KMail::Util::ByteArray( msg.asDwString() ); // and another copy again! } -QCString KMMessage::headerAsSendableString() const +TQCString KMMessage::headerAsSendableString() const { KMMessage msg( new DwMessage( *this->mMsg ) ); msg.removePrivateHeaderFields(); @@ -378,13 +378,13 @@ void KMMessage::setStatusFields() //---------------------------------------------------------------------------- -QString KMMessage::headerAsString() const +TQString KMMessage::headerAsString() const { DwHeaders& header = mMsg->Headers(); header.Assemble(); if ( header.AsString().empty() ) - return QString::null; - return QString::fromLatin1( header.AsString().c_str() ); + return TQString::null; + return TQString::fromLatin1( header.AsString().c_str() ); } @@ -394,11 +394,11 @@ DwMediaType& KMMessage::dwContentType() return mMsg->Headers().ContentType(); } -void KMMessage::fromByteArray( const QByteArray & ba, bool setStatus ) { +void KMMessage::fromByteArray( const TQByteArray & ba, bool setStatus ) { return fromDwString( DwString( ba.data(), ba.size() ), setStatus ); } -void KMMessage::fromString( const QCString & str, bool aSetStatus ) { +void KMMessage::fromString( const TQCString & str, bool aSetStatus ) { return fromDwString( KMail::Util::dwString( str ), aSetStatus ); } @@ -424,10 +424,10 @@ void KMMessage::fromDwString(const DwString& str, bool aSetStatus) //----------------------------------------------------------------------------- -QString KMMessage::formatString(const QString& aStr) const +TQString KMMessage::formatString(const TQString& aStr) const { - QString result, str; - QChar ch; + TQString result, str; + TQChar ch; uint j; if (aStr.isEmpty()) @@ -505,7 +505,7 @@ QString KMMessage::formatString(const QString& aStr) const return result; } -static void removeTrailingSpace( QString &line ) +static void removeTrailingSpace( TQString &line ) { int i = line.length()-1; while( (i >= 0) && ((line[i] == ' ') || (line[i] == '\t'))) @@ -513,7 +513,7 @@ static void removeTrailingSpace( QString &line ) line.truncate( i+1); } -static QString splitLine( QString &line) +static TQString splitLine( TQString &line) { removeTrailingSpace( line ); int i = 0; @@ -524,7 +524,7 @@ static QString splitLine( QString &line) while(i < l) { - QChar c = line[i]; + TQChar c = line[i]; if ((c == '>') || (c == ':') || (c == '|')) j = i+1; else if ((c != ' ') && (c != '\t')) @@ -538,24 +538,24 @@ static QString splitLine( QString &line) } if ( i == l ) { - QString result = line.left(j); - line = QString::null; + TQString result = line.left(j); + line = TQString::null; return result; } - QString result = line.left(j); + TQString result = line.left(j); line = line.mid(j); return result; } -static QString flowText(QString &text, const QString& indent, int maxLength) +static TQString flowText(TQString &text, const TQString& indent, int maxLength) { maxLength--; if (text.isEmpty()) { return indent+"<NULL>\n"; } - QString result; + TQString result; while (1) { int i; @@ -577,11 +577,11 @@ static QString flowText(QString &text, const QString& indent, int maxLength) i = text.length(); } - QString line = text.left(i); + TQString line = text.left(i); if (i < (int) text.length()) text = text.mid(i); else - text = QString::null; + text = TQString::null; result += indent + line + '\n'; @@ -590,8 +590,8 @@ static QString flowText(QString &text, const QString& indent, int maxLength) } } -static bool flushPart(QString &msg, QStringList &part, - const QString &indent, int maxLength) +static bool flushPart(TQString &msg, TQStringList &part, + const TQString &indent, int maxLength) { maxLength -= indent.length(); if (maxLength < 20) maxLength = 20; @@ -602,12 +602,12 @@ static bool flushPart(QString &msg, QStringList &part, part.remove(part.fromLast()); } - QString text; - for(QStringList::Iterator it2 = part.begin(); + TQString text; + for(TQStringList::Iterator it2 = part.begin(); it2 != part.end(); it2++) { - QString line = (*it2); + TQString line = (*it2); if (line.isEmpty()) { @@ -637,35 +637,35 @@ static bool flushPart(QString &msg, QStringList &part, return appendEmptyLine; } -static QString stripSignature( const QString & msg, bool clearSigned ) { +static TQString stripSignature( const TQString & msg, bool clearSigned ) { if ( clearSigned ) - return msg.left( msg.findRev( QRegExp( "\n--\\s?\n" ) ) ); + return msg.left( msg.findRev( TQRegExp( "\n--\\s?\n" ) ) ); else return msg.left( msg.findRev( "\n-- \n" ) ); } -QString KMMessage::smartQuote( const QString & msg, int maxLineLength ) +TQString KMMessage::smartQuote( const TQString & msg, int maxLineLength ) { - QStringList part; - QString oldIndent; + TQStringList part; + TQString oldIndent; bool firstPart = true; - const QStringList lines = QStringList::split('\n', msg, true); + const TQStringList lines = TQStringList::split('\n', msg, true); - QString result; - for(QStringList::const_iterator it = lines.begin(); + TQString result; + for(TQStringList::const_iterator it = lines.begin(); it != lines.end(); ++it) { - QString line = *it; + TQString line = *it; - const QString indent = splitLine( line ); + const TQString indent = splitLine( line ); if ( line.isEmpty()) { if (!firstPart) - part.append(QString::null); + part.append(TQString::null); continue; }; @@ -677,11 +677,11 @@ QString KMMessage::smartQuote( const QString & msg, int maxLineLength ) if (oldIndent != indent) { - QString fromLine; + TQString fromLine; // Search if the last non-blank line could be "From" line if (part.count() && (oldIndent.length() < indent.length())) { - QStringList::Iterator it2 = part.fromLast(); + TQStringList::Iterator it2 = part.fromLast(); while( (it2 != part.end()) && (*it2).isEmpty()) --it2; @@ -713,8 +713,8 @@ QString KMMessage::smartQuote( const QString & msg, int maxLineLength ) //----------------------------------------------------------------------------- void KMMessage::parseTextStringFromDwPart( partNode * root, - QCString& parsedString, - const QTextCodec*& codec, + TQCString& parsedString, + const TQTextCodec*& codec, bool& isHTML ) const { if ( !root ) return; @@ -743,13 +743,13 @@ void KMMessage::parseTextStringFromDwPart( partNode * root, //----------------------------------------------------------------------------- -QString KMMessage::asPlainText( bool aStripSignature, bool allowDecryption ) const { - QCString parsedString; +TQString KMMessage::asPlainText( bool aStripSignature, bool allowDecryption ) const { + TQCString parsedString; bool isHTML = false; - const QTextCodec * codec = 0; + const TQTextCodec * codec = 0; partNode * root = partNode::fromMessage( this ); - if ( !root ) return QString::null; + if ( !root ) return TQString::null; parseTextStringFromDwPart( root, parsedString, codec, isHTML ); delete root; @@ -757,15 +757,15 @@ QString KMMessage::asPlainText( bool aStripSignature, bool allowDecryption ) con codec = this->codec(); if ( parsedString.isEmpty() ) - return QString::null; + return TQString::null; bool clearSigned = false; - QString result; + TQString result; // decrypt if ( allowDecryption ) { - QPtrList<Kpgp::Block> pgpBlocks; - QStrList nonPgpBlocks; + TQPtrList<Kpgp::Block> pgpBlocks; + TQStrList nonPgpBlocks; if ( Kpgp::Module::prepareMessageForDecryption( parsedString, pgpBlocks, nonPgpBlocks ) ) { @@ -820,28 +820,28 @@ QString KMMessage::asPlainText( bool aStripSignature, bool allowDecryption ) con return result; } -QString KMMessage::asQuotedString( const QString& aHeaderStr, - const QString& aIndentStr, - const QString& selection /* = QString::null */, +TQString KMMessage::asQuotedString( const TQString& aHeaderStr, + const TQString& aIndentStr, + const TQString& selection /* = TQString::null */, bool aStripSignature /* = true */, bool allowDecryption /* = true */) const { - QString content = selection.isEmpty() ? + TQString content = selection.isEmpty() ? asPlainText( aStripSignature, allowDecryption ) : selection ; // Remove blank lines at the beginning: - const int firstNonWS = content.find( QRegExp( "\\S" ) ); + 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 QString indentStr = formatString( aIndentStr ); + const TQString indentStr = formatString( aIndentStr ); content.replace( '\n', '\n' + indentStr ); content.prepend( indentStr ); content += '\n'; - const QString headerStr = formatString( aHeaderStr ); + const TQString headerStr = formatString( aHeaderStr ); if ( sSmartQuote && sWordWrap ) return headerStr + smartQuote( content, sWrapCol ); return headerStr + content; @@ -849,16 +849,16 @@ QString KMMessage::asQuotedString( const QString& aHeaderStr, //----------------------------------------------------------------------------- KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy, - QString selection /* = QString::null */, + TQString selection /* = TQString::null */, bool noQuote /* = false */, bool allowDecryption /* = true */, bool selectionIsBody /* = false */, - const QString &tmpl /* = QString::null */ ) + const TQString &tmpl /* = TQString::null */ ) { KMMessage* msg = new KMMessage; - QString str, replyStr, mailingListStr, replyToStr, toStr; - QStringList mailingListAddresses; - QCString refStr, headerName; + TQString str, replyStr, mailingListStr, replyToStr, toStr; + TQStringList mailingListAddresses; + TQCString refStr, headerName; bool replyAll = true; msg->initFromMessage(this); @@ -874,8 +874,8 @@ KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy, mailingListAddresses << parent()->mailingListPostAddress(); } if ( headerField("List-Post").find( "mailto:", 0, false ) != -1 ) { - QString listPost = headerField("List-Post"); - QRegExp rx( "<mailto:([^@>]+)@([^>]+)>", false ); + TQString listPost = headerField("List-Post"); + TQRegExp rx( "<mailto:([^@>]+)@([^>]+)>", false ); if ( rx.search( listPost, 0 ) != -1 ) // matched mailingListAddresses << rx.cap(1) + '@' + rx.cap(2); } @@ -902,7 +902,7 @@ KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy, replyAll = false; } // strip all my addresses from the list of recipients - QStringList recipients = KPIM::splitEmailAddrList( toStr ); + TQStringList recipients = KPIM::splitEmailAddrList( toStr ); toStr = stripMyAddressesFromAddressList( recipients ).join(", "); // ... unless the list contains only my addresses (reply to self) if ( toStr.isEmpty() && !recipients.isEmpty() ) @@ -922,21 +922,21 @@ KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy, toStr = replyToStr; } // strip all my addresses from the list of recipients - QStringList recipients = KPIM::splitEmailAddrList( toStr ); + TQStringList recipients = KPIM::splitEmailAddrList( toStr ); toStr = stripMyAddressesFromAddressList( recipients ).join(", "); break; } case KMail::ReplyAll : { - QStringList recipients; - QStringList ccRecipients; + TQStringList recipients; + TQStringList ccRecipients; // add addresses from the Reply-To header to the list of recipients if( !replyToStr.isEmpty() ) { recipients += KPIM::splitEmailAddrList( replyToStr ); // strip all possible mailing list addresses from the list of Reply-To // addresses - for ( QStringList::const_iterator it = mailingListAddresses.begin(); + for ( TQStringList::const_iterator it = mailingListAddresses.begin(); it != mailingListAddresses.end(); ++it ) { recipients = stripAddressFromAddressList( *it, recipients ); @@ -971,12 +971,12 @@ KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy, // merge To header and CC header into a list of CC recipients if( !cc().isEmpty() || !to().isEmpty() ) { - QStringList list; + TQStringList list; if (!to().isEmpty()) list += KPIM::splitEmailAddrList(to()); if (!cc().isEmpty()) list += KPIM::splitEmailAddrList(cc()); - for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { if( !addressIsInAddressList( *it, recipients ) && !addressIsInAddressList( *it, ccRecipients ) ) { ccRecipients += *it; @@ -1008,10 +1008,10 @@ KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy, } case KMail::ReplyAuthor : { if ( !replyToStr.isEmpty() ) { - QStringList recipients = KPIM::splitEmailAddrList( replyToStr ); + TQStringList recipients = KPIM::splitEmailAddrList( replyToStr ); // strip the mailing list post address from the list of Reply-To // addresses since we want to reply in private - for ( QStringList::const_iterator it = mailingListAddresses.begin(); + for ( TQStringList::const_iterator it = mailingListAddresses.begin(); it != mailingListAddresses.end(); ++it ) { recipients = stripAddressFromAddressList( *it, recipients ); @@ -1047,7 +1047,7 @@ KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy, // if (!noQuote) { // if( selectionIsBody ){ -// QCString cStr = selection.latin1(); +// TQCString cStr = selection.latin1(); // msg->setBody( cStr ); // }else{ // msg->setBody(asQuotedString(replyStr + "\n", sIndentPrefixStr, selection, @@ -1082,9 +1082,9 @@ KMMessage* KMMessage::createReply( KMail::ReplyStrategy replyStrategy, //----------------------------------------------------------------------------- -QCString KMMessage::getRefStr() const +TQCString KMMessage::getRefStr() const { - QCString firstRef, lastRef, refStr, retRefStr; + TQCString firstRef, lastRef, refStr, retRefStr; int i, j; refStr = headerField("References").stripWhiteSpace().latin1(); @@ -1110,34 +1110,34 @@ QCString KMMessage::getRefStr() const } -KMMessage* KMMessage::createRedirect( const QString &toStr ) +KMMessage* KMMessage::createRedirect( const TQString &toStr ) { // copy the message 1:1 KMMessage* msg = new KMMessage( new DwMessage( *this->mMsg ) ); KMMessagePart msgPart; uint id = 0; - QString strId = msg->headerField( "X-KMail-Identity" ).stripWhiteSpace(); + TQString strId = msg->headerField( "X-KMail-Identity" ).stripWhiteSpace(); if ( !strId.isEmpty()) id = strId.toUInt(); const KPIM::Identity & ident = kmkernel->identityManager()->identityForUoidOrDefault( id ); // X-KMail-Redirect-From: content - QString strByWayOf = QString("%1 (by way of %2 <%3>)") + TQString strByWayOf = TQString("%1 (by way of %2 <%3>)") .arg( from() ) .arg( ident.fullName() ) .arg( ident.emailAddr() ); // Resent-From: content - QString strFrom = QString("%1 <%2>") + TQString strFrom = TQString("%1 <%2>") .arg( ident.fullName() ) .arg( ident.emailAddr() ); // format the current date to be used in Resent-Date: - QString origDate = msg->headerField( "Date" ); + TQString origDate = msg->headerField( "Date" ); msg->setDateToday(); - QString newDate = msg->headerField( "Date" ); + TQString newDate = msg->headerField( "Date" ); // make sure the Date: header is valid if ( origDate.isEmpty() ) msg->removeHeaderField( "Date" ); @@ -1161,15 +1161,15 @@ KMMessage* KMMessage::createRedirect( const QString &toStr ) //----------------------------------------------------------------------------- -QCString KMMessage::createForwardBody() +TQCString KMMessage::createForwardBody() { - QString s; - QCString str; + TQString s; + TQCString str; if (sHeaderStrategy == HeaderStrategy::all()) { s = "\n\n---------- " + sForwardStr + " ----------\n\n"; s += headerAsString(); - str = asQuotedString(s, "", QString::null, false, false).utf8(); + str = asQuotedString(s, "", TQString::null, false, false).utf8(); str += "\n-------------------------------------------------------\n"; } else { s = "\n\n---------- " + sForwardStr + " ----------\n\n"; @@ -1182,14 +1182,14 @@ QCString KMMessage::createForwardBody() s += "To: " + to() + "\n"; if (!cc().isEmpty()) s += "Cc: " + cc() + "\n"; s += "\n"; - str = asQuotedString(s, "", QString::null, false, false).utf8(); + str = asQuotedString(s, "", TQString::null, false, false).utf8(); str += "\n-------------------------------------------------------\n"; } return str; } -void KMMessage::sanitizeHeaders( const QStringList& whiteList ) +void KMMessage::sanitizeHeaders( const TQStringList& whiteList ) { // Strip out all headers apart from the content description and other // whitelisted ones, because we don't want to inherit them. @@ -1200,7 +1200,7 @@ void KMMessage::sanitizeHeaders( const QStringList& whiteList ) { nextField = field->Next(); if ( field->FieldNameStr().find( "ontent" ) == DwString::npos - && !whiteList.contains( QString::fromLatin1( field->FieldNameStr().c_str() ) ) ) + && !whiteList.contains( TQString::fromLatin1( field->FieldNameStr().c_str() ) ) ) header.RemoveField(field); field = nextField; } @@ -1208,10 +1208,10 @@ void KMMessage::sanitizeHeaders( const QStringList& whiteList ) } //----------------------------------------------------------------------------- -KMMessage* KMMessage::createForward( const QString &tmpl /* = QString::null */ ) +KMMessage* KMMessage::createForward( const TQString &tmpl /* = TQString::null */ ) { KMMessage* msg = new KMMessage(); - QString id; + TQString id; // If this is a multipart mail or if the main part is only the text part, // Make an identical copy of the mail, minus headers, so attachments are @@ -1228,12 +1228,12 @@ KMMessage* KMMessage::createForward( const QString &tmpl /* = QString::null */ ) msg->sanitizeHeaders(); // strip blacklisted parts - QStringList blacklist = GlobalSettings::self()->mimetypesToStripWhenInlineForwarding(); - for ( QStringList::Iterator it = blacklist.begin(); it != blacklist.end(); ++it ) { - QString entry = (*it); + TQStringList blacklist = GlobalSettings::self()->mimetypesToStripWhenInlineForwarding(); + for ( TQStringList::Iterator it = blacklist.begin(); it != blacklist.end(); ++it ) { + TQString entry = (*it); int sep = entry.find( '/' ); - QCString type = entry.left( sep ).latin1(); - QCString subtype = entry.mid( sep+1 ).latin1(); + TQCString type = entry.left( sep ).latin1(); + TQCString subtype = entry.mid( sep+1 ).latin1(); kdDebug( 5006 ) << "Looking for blacklisted type: " << type << "/" << subtype << endl; while ( DwBodyPart * part = msg->findDwBodyPart( type, subtype ) ) { msg->mMsg->Body().RemoveBodyPart( part ); @@ -1283,7 +1283,7 @@ KMMessage* KMMessage::createForward( const QString &tmpl /* = QString::null */ ) msg->mNeedsAssembly = true; msg->cleanupHeader(); } - // QString st = QString::fromUtf8(createForwardBody()); + // TQString st = TQString::fromUtf8(createForwardBody()); msg->setSubject( forwardSubject() ); @@ -1296,7 +1296,7 @@ KMMessage* KMMessage::createForward( const QString &tmpl /* = QString::null */ ) parser.process( this ); } - // QCString encoding = autoDetectCharset(charset(), sPrefCharsets, msg->body()); + // TQCString encoding = autoDetectCharset(charset(), sPrefCharsets, msg->body()); // if (encoding.isEmpty()) encoding = "utf-8"; // msg->setCharset(encoding); @@ -1354,15 +1354,15 @@ static int requestAdviceOnMDN( const char * what ) { for ( int i = 0 ; i < numMdnMessageBoxes ; ++i ) if ( !qstrcmp( what, mdnMessageBoxes[i].dontAskAgainID ) ) if ( mdnMessageBoxes[i].canDeny ) { - const KCursorSaver saver( QCursor::ArrowCursor ); - int answer = QMessageBox::information( 0, + const KCursorSaver saver( TQCursor::ArrowCursor ); + int answer = TQMessageBox::information( 0, i18n("Message Disposition Notification Request"), i18n( mdnMessageBoxes[i].text ), i18n("&Ignore"), i18n("Send \"&denied\""), i18n("&Send") ); return answer ? answer + 1 : 0 ; // map to "mode" in createMDN } else { - const KCursorSaver saver( QCursor::ArrowCursor ); - int answer = QMessageBox::information( 0, + const KCursorSaver saver( TQCursor::ArrowCursor ); + int answer = TQMessageBox::information( 0, i18n("Message Disposition Notification Request"), i18n( mdnMessageBoxes[i].text ), i18n("&Ignore"), i18n("&Send") ); @@ -1376,7 +1376,7 @@ static int requestAdviceOnMDN( const char * what ) { KMMessage* KMMessage::createMDN( MDN::ActionMode a, MDN::DispositionType d, bool allowGUI, - QValueList<MDN::DispositionModifier> m ) + TQValueList<MDN::DispositionModifier> m ) { // RFC 2298: At most one MDN may be issued on behalf of each // particular recipient by their user agent. That is, once an MDN @@ -1401,13 +1401,13 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a, } // extract where to send to: - QString receiptTo = headerField("Disposition-Notification-To"); + TQString receiptTo = headerField("Disposition-Notification-To"); if ( receiptTo.stripWhiteSpace().isEmpty() ) return 0; receiptTo.remove( '\n' ); MDN::SendingMode s = MDN::SentAutomatically; // set to manual if asked user - QString special; // fill in case of error, warning or failure + TQString special; // fill in case of error, warning or failure KConfigGroup mdnConfig( KMKernel::config(), "MDN" ); // default: @@ -1424,7 +1424,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a, // not understand the meaning of the parameter, it MUST NOT generate // an MDN with any disposition type other than "failed" in response // to the request. - QString notificationOptions = headerField("Disposition-Notification-Options"); + TQString notificationOptions = headerField("Disposition-Notification-Options"); if ( notificationOptions.contains( "required", false ) ) { // ### hacky; should parse... // There is a required option that we don't understand. We need to @@ -1456,7 +1456,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a, // SHOULD be obtained (or no MDN sent) if there is no Return-Path // header in the message [...] AddrSpecList returnPathList = extractAddrSpecs("Return-Path"); - QString returnPath = returnPathList.isEmpty() ? QString::null + 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 ) ) { @@ -1495,7 +1495,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a, // extract where to send from: - QString finalRecipient = kmkernel->identityManager() + TQString finalRecipient = kmkernel->identityManager() ->identityForUoidOrDefault( identityUoid() ).fullEmailAddr(); // @@ -1516,7 +1516,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a, receipt->mNeedsAssembly = true; receipt->setContentTypeParam( "report-type", "disposition-notification" ); - QString description = replaceHeadersInString( MDN::descriptionFor( d, m ) ); + TQString description = replaceHeadersInString( MDN::descriptionFor( d, m ) ); // text/plain part: KMMessagePart firstMsgPart; @@ -1588,15 +1588,15 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a, return receipt; } -QString KMMessage::replaceHeadersInString( const QString & s ) const { - QString result = s; - QRegExp rx( "\\$\\{([a-z0-9-]+)\\}", false ); +TQString KMMessage::replaceHeadersInString( const TQString & s ) const { + TQString result = s; + TQRegExp rx( "\\$\\{([a-z0-9-]+)\\}", false ); Q_ASSERT( rx.isValid() ); - QRegExp rxDate( "\\$\\{date\\}" ); + TQRegExp rxDate( "\\$\\{date\\}" ); Q_ASSERT( rxDate.isValid() ); - QString sDate = KMime::DateFormatter::formatDate( + TQString sDate = KMime::DateFormatter::formatDate( KMime::DateFormatter::Localized, date() ); int idx = 0; @@ -1606,7 +1606,7 @@ QString KMMessage::replaceHeadersInString( const QString & s ) const { idx = 0; while ( ( idx = rx.search( result, idx ) ) != -1 ) { - QString replacement = headerField( rx.cap(1).latin1() ); + TQString replacement = headerField( rx.cap(1).latin1() ); result.replace( idx, rx.matchedLength(), replacement ); idx += replacement.length(); } @@ -1615,7 +1615,7 @@ QString KMMessage::replaceHeadersInString( const QString & s ) const { KMMessage* KMMessage::createDeliveryReceipt() const { - QString str, receiptTo; + TQString str, receiptTo; KMMessage *receipt; receiptTo = headerField("Disposition-Notification-To"); @@ -1668,7 +1668,7 @@ void KMMessage::applyIdentity( uint id ) if (ident.isDefault()) removeHeaderField("X-KMail-Identity"); else - setHeaderField("X-KMail-Identity", QString::number( ident.uoid() )); + setHeaderField("X-KMail-Identity", TQString::number( ident.uoid() )); if ( ident.transport().isEmpty() ) removeHeaderField( "X-KMail-Transport" ); @@ -1676,17 +1676,17 @@ void KMMessage::applyIdentity( uint id ) setHeaderField( "X-KMail-Transport", ident.transport() ); if ( ident.fcc().isEmpty() ) - setFcc( QString::null ); + setFcc( TQString::null ); else setFcc( ident.fcc() ); if ( ident.drafts().isEmpty() ) - setDrafts( QString::null ); + setDrafts( TQString::null ); else setDrafts( ident.drafts() ); if ( ident.templates().isEmpty() ) - setTemplates( QString::null ); + setTemplates( TQString::null ); else setTemplates( ident.templates() ); @@ -1706,7 +1706,7 @@ void KMMessage::initHeader( uint id ) } uint KMMessage::identityUoid() const { - QString idString = headerField("X-KMail-Identity").stripWhiteSpace(); + TQString idString = headerField("X-KMail-Identity").stripWhiteSpace(); bool ok = false; int id = idString.toUInt( &ok ); @@ -1725,7 +1725,7 @@ void KMMessage::initFromMessage(const KMMessage *msg, bool idHeaders) uint id = msg->identityUoid(); if ( idHeaders ) initHeader(id); - else setHeaderField("X-KMail-Identity", QString::number(id)); + else setHeaderField("X-KMail-Identity", TQString::number(id)); if (!msg->headerField("X-KMail-Transport").isEmpty()) setHeaderField("X-KMail-Transport", msg->headerField("X-KMail-Transport")); } @@ -1775,7 +1775,7 @@ void KMMessage::setAutomaticFields(bool aIsMulti) //----------------------------------------------------------------------------- -QString KMMessage::dateStr() const +TQString KMMessage::dateStr() const { KConfigGroup general( KMKernel::config(), "General" ); DwHeaders& header = mMsg->Headers(); @@ -1793,7 +1793,7 @@ QString KMMessage::dateStr() const //----------------------------------------------------------------------------- -QCString KMMessage::dateShortStr() const +TQCString KMMessage::dateShortStr() const { DwHeaders& header = mMsg->Headers(); time_t unixTime; @@ -1801,7 +1801,7 @@ QCString KMMessage::dateShortStr() const if (!header.HasDate()) return ""; unixTime = header.Date().AsUnixTime(); - QCString result = ctime(&unixTime); + TQCString result = ctime(&unixTime); int len = result.length(); if (result[len-1]=='\n') result.truncate(len-1); @@ -1811,7 +1811,7 @@ QCString KMMessage::dateShortStr() const //----------------------------------------------------------------------------- -QString KMMessage::dateIsoStr() const +TQString KMMessage::dateIsoStr() const { DwHeaders& header = mMsg->Headers(); time_t unixTime; @@ -1821,7 +1821,7 @@ QString KMMessage::dateIsoStr() const char cstr[64]; strftime(cstr, 63, "%Y-%m-%d %H:%M:%S", localtime(&unixTime)); - return QString(cstr); + return TQString(cstr); } @@ -1857,7 +1857,7 @@ void KMMessage::setDate(time_t aDate) //----------------------------------------------------------------------------- -void KMMessage::setDate(const QCString& aStr) +void KMMessage::setDate(const TQCString& aStr) { DwHeaders& header = mMsg->Headers(); @@ -1872,12 +1872,12 @@ void KMMessage::setDate(const QCString& aStr) //----------------------------------------------------------------------------- -QString KMMessage::to() const +TQString KMMessage::to() const { // handle To same as Cc below, bug 80747 - QValueList<QCString> rawHeaders = rawHeaderFields( "To" ); - QStringList headers; - for ( QValueList<QCString>::Iterator it = rawHeaders.begin(); it != rawHeaders.end(); ++it ) { + TQValueList<TQCString> rawHeaders = rawHeaderFields( "To" ); + TQStringList headers; + for ( TQValueList<TQCString>::Iterator it = rawHeaders.begin(); it != rawHeaders.end(); ++it ) { headers << *it; } return KPIM::normalizeAddressesAndDecodeIDNs( headers.join( ", " ) ); @@ -1885,26 +1885,26 @@ QString KMMessage::to() const //----------------------------------------------------------------------------- -void KMMessage::setTo(const QString& aStr) +void KMMessage::setTo(const TQString& aStr) { setHeaderField( "To", aStr, Address ); } //----------------------------------------------------------------------------- -QString KMMessage::toStrip() const +TQString KMMessage::toStrip() const { return stripEmailAddr( to() ); } //----------------------------------------------------------------------------- -QString KMMessage::replyTo() const +TQString KMMessage::replyTo() const { return KPIM::normalizeAddressesAndDecodeIDNs( rawHeaderField("Reply-To") ); } //----------------------------------------------------------------------------- -void KMMessage::setReplyTo(const QString& aStr) +void KMMessage::setReplyTo(const TQString& aStr) { setHeaderField( "Reply-To", aStr, Address ); } @@ -1918,13 +1918,13 @@ void KMMessage::setReplyTo(KMMessage* aMsg) //----------------------------------------------------------------------------- -QString KMMessage::cc() const +TQString KMMessage::cc() const { // get the combined contents of all Cc headers (as workaround for invalid // messages with multiple Cc headers) - QValueList<QCString> rawHeaders = rawHeaderFields( "Cc" ); - QStringList headers; - for ( QValueList<QCString>::Iterator it = rawHeaders.begin(); it != rawHeaders.end(); ++it ) { + TQValueList<TQCString> rawHeaders = rawHeaderFields( "Cc" ); + TQStringList headers; + for ( TQValueList<TQCString>::Iterator it = rawHeaders.begin(); it != rawHeaders.end(); ++it ) { headers << *it; } return KPIM::normalizeAddressesAndDecodeIDNs( headers.join( ", " ) ); @@ -1932,59 +1932,59 @@ QString KMMessage::cc() const //----------------------------------------------------------------------------- -void KMMessage::setCc(const QString& aStr) +void KMMessage::setCc(const TQString& aStr) { setHeaderField( "Cc", aStr, Address ); } //----------------------------------------------------------------------------- -QString KMMessage::ccStrip() const +TQString KMMessage::ccStrip() const { return stripEmailAddr( cc() ); } //----------------------------------------------------------------------------- -QString KMMessage::bcc() const +TQString KMMessage::bcc() const { return KPIM::normalizeAddressesAndDecodeIDNs( rawHeaderField("Bcc") ); } //----------------------------------------------------------------------------- -void KMMessage::setBcc(const QString& aStr) +void KMMessage::setBcc(const TQString& aStr) { setHeaderField( "Bcc", aStr, Address ); } //----------------------------------------------------------------------------- -QString KMMessage::fcc() const +TQString KMMessage::fcc() const { return headerField( "X-KMail-Fcc" ); } //----------------------------------------------------------------------------- -void KMMessage::setFcc( const QString &aStr ) +void KMMessage::setFcc( const TQString &aStr ) { setHeaderField( "X-KMail-Fcc", aStr ); } //----------------------------------------------------------------------------- -void KMMessage::setDrafts( const QString &aStr ) +void KMMessage::setDrafts( const TQString &aStr ) { mDrafts = aStr; } //----------------------------------------------------------------------------- -void KMMessage::setTemplates( const QString &aStr ) +void KMMessage::setTemplates( const TQString &aStr ) { mTemplates = aStr; } //----------------------------------------------------------------------------- -QString KMMessage::who() const +TQString KMMessage::who() const { if (mParent) return KPIM::normalizeAddressesAndDecodeIDNs( rawHeaderField(mParent->whoField().utf8()) ); @@ -1993,16 +1993,16 @@ QString KMMessage::who() const //----------------------------------------------------------------------------- -QString KMMessage::from() const +TQString KMMessage::from() const { return KPIM::normalizeAddressesAndDecodeIDNs( rawHeaderField("From") ); } //----------------------------------------------------------------------------- -void KMMessage::setFrom(const QString& bStr) +void KMMessage::setFrom(const TQString& bStr) { - QString aStr = bStr; + TQString aStr = bStr; if (aStr.isNull()) aStr = ""; setHeaderField( "From", aStr, Address ); @@ -2011,30 +2011,30 @@ void KMMessage::setFrom(const QString& bStr) //----------------------------------------------------------------------------- -QString KMMessage::fromStrip() const +TQString KMMessage::fromStrip() const { return stripEmailAddr( from() ); } //----------------------------------------------------------------------------- -QString KMMessage::sender() const { +TQString KMMessage::sender() const { AddrSpecList asl = extractAddrSpecs( "Sender" ); if ( asl.empty() ) asl = extractAddrSpecs( "From" ); if ( asl.empty() ) - return QString::null; + return TQString::null; return asl.front().asString(); } //----------------------------------------------------------------------------- -QString KMMessage::subject() const +TQString KMMessage::subject() const { return headerField("Subject"); } //----------------------------------------------------------------------------- -void KMMessage::setSubject(const QString& aStr) +void KMMessage::setSubject(const TQString& aStr) { setHeaderField("Subject",aStr); mDirty = true; @@ -2042,14 +2042,14 @@ void KMMessage::setSubject(const QString& aStr) //----------------------------------------------------------------------------- -QString KMMessage::xmark() const +TQString KMMessage::xmark() const { return headerField("X-KMail-Mark"); } //----------------------------------------------------------------------------- -void KMMessage::setXMark(const QString& aStr) +void KMMessage::setXMark(const TQString& aStr) { setHeaderField("X-KMail-Mark", aStr); mDirty = true; @@ -2057,10 +2057,10 @@ void KMMessage::setXMark(const QString& aStr) //----------------------------------------------------------------------------- -QString KMMessage::replyToId() const +TQString KMMessage::replyToId() const { int leftAngle, rightAngle; - QString replyTo, references; + TQString replyTo, references; replyTo = headerField("In-Reply-To"); // search the end of the (first) message id in the In-Reply-To header @@ -2098,15 +2098,15 @@ QString KMMessage::replyToId() const //----------------------------------------------------------------------------- -QString KMMessage::replyToIdMD5() const { +TQString KMMessage::replyToIdMD5() const { return base64EncodedMD5( replyToId() ); } //----------------------------------------------------------------------------- -QString KMMessage::references() const +TQString KMMessage::references() const { int leftAngle, rightAngle; - QString references = headerField( "References" ); + TQString references = headerField( "References" ); // keep the last two entries for threading leftAngle = references.findRev( '<' ); @@ -2120,13 +2120,13 @@ QString KMMessage::references() const if( !references.isEmpty() && references[0] == '<' ) return references; else - return QString::null; + return TQString::null; } //----------------------------------------------------------------------------- -QString KMMessage::replyToAuxIdMD5() const +TQString KMMessage::replyToAuxIdMD5() const { - QString result = references(); + TQString result = references(); // references contains two items, use the first one // (the second to last reference) const int rightAngle = result.find( '>' ); @@ -2137,12 +2137,12 @@ QString KMMessage::replyToAuxIdMD5() const } //----------------------------------------------------------------------------- -QString KMMessage::strippedSubjectMD5() const { +TQString KMMessage::strippedSubjectMD5() const { return base64EncodedMD5( stripOffPrefixes( subject() ), true /*utf8*/ ); } //----------------------------------------------------------------------------- -QString KMMessage::subjectMD5() const { +TQString KMMessage::subjectMD5() const { return base64EncodedMD5( subject(), true /*utf8*/ ); } @@ -2152,7 +2152,7 @@ bool KMMessage::subjectIsPrefixed() const { } //----------------------------------------------------------------------------- -void KMMessage::setReplyToId(const QString& aStr) +void KMMessage::setReplyToId(const TQString& aStr) { setHeaderField("In-Reply-To", aStr); mDirty = true; @@ -2160,9 +2160,9 @@ void KMMessage::setReplyToId(const QString& aStr) //----------------------------------------------------------------------------- -QString KMMessage::msgId() const +TQString KMMessage::msgId() const { - QString msgId = headerField("Message-Id"); + TQString msgId = headerField("Message-Id"); // search the end of the message id const int rightAngle = msgId.find( '>' ); @@ -2177,13 +2177,13 @@ QString KMMessage::msgId() const //----------------------------------------------------------------------------- -QString KMMessage::msgIdMD5() const { +TQString KMMessage::msgIdMD5() const { return base64EncodedMD5( msgId() ); } //----------------------------------------------------------------------------- -void KMMessage::setMsgId(const QString& aStr) +void KMMessage::setMsgId(const TQString& aStr) { setHeaderField("Message-Id", aStr); mDirty = true; @@ -2198,7 +2198,7 @@ size_t KMMessage::msgSizeServer() const { //----------------------------------------------------------------------------- void KMMessage::setMsgSizeServer(size_t size) { - setHeaderField("X-Length", QCString().setNum(size)); + setHeaderField("X-Length", TQCString().setNum(size)); mDirty = true; } @@ -2211,12 +2211,12 @@ ulong KMMessage::UID() const { //----------------------------------------------------------------------------- void KMMessage::setUID(ulong uid) { - setHeaderField("X-UID", QCString().setNum(uid)); + setHeaderField("X-UID", TQCString().setNum(uid)); mDirty = true; } //----------------------------------------------------------------------------- -AddressList KMMessage::splitAddrField( const QCString & str ) +AddressList KMMessage::splitAddrField( const TQCString & str ) { AddressList result; const char * scursor = str.begin(); @@ -2229,11 +2229,11 @@ AddressList KMMessage::splitAddrField( const QCString & str ) return result; } -AddressList KMMessage::headerAddrField( const QCString & aName ) const { +AddressList KMMessage::headerAddrField( const TQCString & aName ) const { return KMMessage::splitAddrField( rawHeaderField( aName ) ); } -AddrSpecList KMMessage::extractAddrSpecs( const QCString & header ) const { +AddrSpecList KMMessage::extractAddrSpecs( const TQCString & header ) const { AddressList al = headerAddrField( header ); AddrSpecList result; for ( AddressList::const_iterator ait = al.begin() ; ait != al.end() ; ++ait ) @@ -2242,24 +2242,24 @@ AddrSpecList KMMessage::extractAddrSpecs( const QCString & header ) const { return result; } -QCString KMMessage::rawHeaderField( const QCString & name ) const { - if ( name.isEmpty() ) return QCString(); +TQCString KMMessage::rawHeaderField( const TQCString & name ) const { + if ( name.isEmpty() ) return TQCString(); DwHeaders & header = mMsg->Headers(); DwField * field = header.FindField( name ); - if ( !field ) return QCString(); + if ( !field ) return TQCString(); return header.FieldBody( name.data() ).AsString().c_str(); } -QValueList<QCString> KMMessage::rawHeaderFields( const QCString& field ) const +TQValueList<TQCString> KMMessage::rawHeaderFields( const TQCString& field ) const { if ( field.isEmpty() || !mMsg->Headers().FindField( field ) ) - return QValueList<QCString>(); + return TQValueList<TQCString>(); std::vector<DwFieldBody*> v = mMsg->Headers().AllFieldBodies( field.data() ); - QValueList<QCString> headerFields; + TQValueList<TQCString> headerFields; for ( uint i = 0; i < v.size(); ++i ) { headerFields.append( v[i]->AsString().c_str() ); } @@ -2267,26 +2267,26 @@ QValueList<QCString> KMMessage::rawHeaderFields( const QCString& field ) const return headerFields; } -QString KMMessage::headerField(const QCString& aName) const +TQString KMMessage::headerField(const TQCString& aName) const { if ( aName.isEmpty() ) - return QString::null; + return TQString::null; if ( !mMsg->Headers().FindField( aName ) ) - return QString::null; + return TQString::null; return decodeRFC2047String( mMsg->Headers().FieldBody( aName.data() ).AsString().c_str(), charset() ); } -QStringList KMMessage::headerFields( const QCString& field ) const +TQStringList KMMessage::headerFields( const TQCString& field ) const { if ( field.isEmpty() || !mMsg->Headers().FindField( field ) ) - return QStringList(); + return TQStringList(); std::vector<DwFieldBody*> v = mMsg->Headers().AllFieldBodies( field.data() ); - QStringList headerFields; + TQStringList headerFields; for ( uint i = 0; i < v.size(); ++i ) { headerFields.append( decodeRFC2047String( v[i]->AsString().c_str(), charset() ) ); } @@ -2295,7 +2295,7 @@ QStringList KMMessage::headerFields( const QCString& field ) const } //----------------------------------------------------------------------------- -void KMMessage::removeHeaderField(const QCString& aName) +void KMMessage::removeHeaderField(const TQCString& aName) { DwHeaders & header = mMsg->Headers(); DwField * field = header.FindField(aName); @@ -2306,7 +2306,7 @@ void KMMessage::removeHeaderField(const QCString& aName) } //----------------------------------------------------------------------------- -void KMMessage::removeHeaderFields(const QCString& aName) +void KMMessage::removeHeaderFields(const TQCString& aName) { DwHeaders & header = mMsg->Headers(); while ( DwField * field = header.FindField(aName) ) { @@ -2317,7 +2317,7 @@ void KMMessage::removeHeaderFields(const QCString& aName) //----------------------------------------------------------------------------- -void KMMessage::setHeaderField( const QCString& aName, const QString& bValue, +void KMMessage::setHeaderField( const TQCString& aName, const TQString& bValue, HeaderFieldType type, bool prepend ) { #if 0 @@ -2331,17 +2331,17 @@ void KMMessage::setHeaderField( const QCString& aName, const QString& bValue, DwString str; DwField* field; - QCString aValue; + TQCString aValue; if (!bValue.isEmpty()) { - QString value = bValue; + TQString value = bValue; if ( type == Address ) value = KPIM::normalizeAddressesAndEncodeIDNs( value ); #if 0 if ( type != Unstructured ) kdDebug(5006) << "value: \"" << value << "\"" << endl; #endif - QCString encoding = autoDetectCharset( charset(), sPrefCharsets, value ); + TQCString encoding = autoDetectCharset( charset(), sPrefCharsets, value ); if (encoding.isEmpty()) encoding = "utf-8"; aValue = encodeRFC2047String( value, encoding ); @@ -2369,7 +2369,7 @@ void KMMessage::setHeaderField( const QCString& aName, const QString& bValue, //----------------------------------------------------------------------------- -QCString KMMessage::typeStr() const +TQCString KMMessage::typeStr() const { DwHeaders& header = mMsg->Headers(); if (header.HasContentType()) return header.ContentType().TypeStr().c_str(); @@ -2387,7 +2387,7 @@ int KMMessage::type() const //----------------------------------------------------------------------------- -void KMMessage::setTypeStr(const QCString& aStr) +void KMMessage::setTypeStr(const TQCString& aStr) { dwContentType().SetTypeStr(DwString(aStr)); dwContentType().Parse(); @@ -2406,7 +2406,7 @@ void KMMessage::setType(int aType) //----------------------------------------------------------------------------- -QCString KMMessage::subtypeStr() const +TQCString KMMessage::subtypeStr() const { DwHeaders& header = mMsg->Headers(); if (header.HasContentType()) return header.ContentType().SubtypeStr().c_str(); @@ -2424,7 +2424,7 @@ int KMMessage::subtype() const //----------------------------------------------------------------------------- -void KMMessage::setSubtypeStr(const QCString& aStr) +void KMMessage::setSubtypeStr(const TQCString& aStr) { dwContentType().SetSubtypeStr(DwString(aStr)); dwContentType().Parse(); @@ -2443,8 +2443,8 @@ void KMMessage::setSubtype(int aSubtype) //----------------------------------------------------------------------------- void KMMessage::setDwMediaTypeParam( DwMediaType &mType, - const QCString& attr, - const QCString& val ) + const TQCString& attr, + const TQCString& val ) { mType.Parse(); DwParameter *param = mType.FirstParameter(); @@ -2467,7 +2467,7 @@ void KMMessage::setDwMediaTypeParam( DwMediaType &mType, //----------------------------------------------------------------------------- -void KMMessage::setContentTypeParam(const QCString& attr, const QCString& val) +void KMMessage::setContentTypeParam(const TQCString& attr, const TQCString& val) { if (mNeedsAssembly) mMsg->Assemble(); mNeedsAssembly = false; @@ -2477,7 +2477,7 @@ void KMMessage::setContentTypeParam(const QCString& attr, const QCString& val) //----------------------------------------------------------------------------- -QCString KMMessage::contentTransferEncodingStr() const +TQCString KMMessage::contentTransferEncodingStr() const { DwHeaders& header = mMsg->Headers(); if (header.HasContentTransferEncoding()) @@ -2497,7 +2497,7 @@ int KMMessage::contentTransferEncoding() const //----------------------------------------------------------------------------- -void KMMessage::setContentTransferEncodingStr(const QCString& aStr) +void KMMessage::setContentTransferEncodingStr(const TQCString& aStr) { mMsg->Headers().ContentTransferEncoding().FromString(aStr); mMsg->Headers().ContentTransferEncoding().Parse(); @@ -2528,10 +2528,10 @@ void KMMessage::setNeedsAssembly() //----------------------------------------------------------------------------- -QCString KMMessage::body() const +TQCString KMMessage::body() const { const DwString& body = mMsg->Body().AsString(); - QCString str = KMail::Util::CString( body ); + TQCString str = KMail::Util::CString( body ); // Calls length() -> slow //kdWarning( str.length() != body.length(), 5006 ) // << "KMMessage::body(): body is binary but used as text!" << endl; @@ -2540,7 +2540,7 @@ QCString KMMessage::body() const //----------------------------------------------------------------------------- -QByteArray KMMessage::bodyDecodedBinary() const +TQByteArray KMMessage::bodyDecodedBinary() const { DwString dwstr; const DwString& dwsrc = mMsg->Body().AsString(); @@ -2559,14 +2559,14 @@ QByteArray KMMessage::bodyDecodedBinary() const } int len = dwstr.size(); - QByteArray ba(len); + TQByteArray ba(len); memcpy(ba.data(),dwstr.data(),len); return ba; } //----------------------------------------------------------------------------- -QCString KMMessage::bodyDecoded() const +TQCString KMMessage::bodyDecoded() const { DwString dwstr; DwString dwsrc = mMsg->Body().AsString(); @@ -2586,8 +2586,8 @@ QCString KMMessage::bodyDecoded() const return KMail::Util::CString( dwstr ); - // Calling QCString::length() is slow - //QCString result = KMail::Util::CString( dwstr ); + // Calling TQCString::length() is slow + //TQCString result = KMail::Util::CString( dwstr ); //kdWarning(result.length() != len, 5006) // << "KMMessage::bodyDecoded(): body is binary but used as text!" << endl; //return result; @@ -2595,11 +2595,11 @@ QCString KMMessage::bodyDecoded() const //----------------------------------------------------------------------------- -QValueList<int> KMMessage::determineAllowedCtes( const CharFreq& cf, +TQValueList<int> KMMessage::determineAllowedCtes( const CharFreq& cf, bool allow8Bit, bool willBeSigned ) { - QValueList<int> allowedCtes; + TQValueList<int> allowedCtes; switch ( cf.type() ) { case CharFreq::SevenBitText: @@ -2643,8 +2643,8 @@ QValueList<int> KMMessage::determineAllowedCtes( const CharFreq& cf, //----------------------------------------------------------------------------- -void KMMessage::setBodyAndGuessCte( const QByteArray& aBuf, - QValueList<int> & allowedCte, +void KMMessage::setBodyAndGuessCte( const TQByteArray& aBuf, + TQValueList<int> & allowedCte, bool allow8Bit, bool willBeSigned ) { @@ -2666,8 +2666,8 @@ void KMMessage::setBodyAndGuessCte( const QByteArray& aBuf, //----------------------------------------------------------------------------- -void KMMessage::setBodyAndGuessCte( const QCString& aBuf, - QValueList<int> & allowedCte, +void KMMessage::setBodyAndGuessCte( const TQCString& aBuf, + TQValueList<int> & allowedCte, bool allow8Bit, bool willBeSigned ) { @@ -2689,7 +2689,7 @@ void KMMessage::setBodyAndGuessCte( const QCString& aBuf, //----------------------------------------------------------------------------- -void KMMessage::setBodyEncoded(const QCString& aStr) +void KMMessage::setBodyEncoded(const TQCString& aStr) { DwString dwSrc(aStr.data(), aStr.size()-1 /* not the trailing NUL */); DwString dwResult; @@ -2712,7 +2712,7 @@ void KMMessage::setBodyEncoded(const QCString& aStr) } //----------------------------------------------------------------------------- -void KMMessage::setBodyEncodedBinary(const QByteArray& aStr) +void KMMessage::setBodyEncodedBinary(const TQByteArray& aStr) { DwString dwSrc(aStr.data(), aStr.size()); DwString dwResult; @@ -2736,7 +2736,7 @@ void KMMessage::setBodyEncodedBinary(const QByteArray& aStr) //----------------------------------------------------------------------------- -void KMMessage::setBody(const QCString& aStr) +void KMMessage::setBody(const TQCString& aStr) { mMsg->Body().FromString(KMail::Util::dwString(aStr)); mNeedsAssembly = true; @@ -2752,7 +2752,7 @@ void KMMessage::setBody(const char* aStr) mNeedsAssembly = true; } -void KMMessage::setMultiPartBody( const QCString & aStr ) { +void KMMessage::setMultiPartBody( const TQCString & aStr ) { setBody( aStr ); mMsg->Body().Parse(); mNeedsAssembly = true; @@ -2771,7 +2771,7 @@ int KMMessage::numBodyParts() const { int count = 0; DwBodyPart* part = getFirstDwBodyPart(); - QPtrList< DwBodyPart > parts; + TQPtrList< DwBodyPart > parts; while (part) { @@ -2819,7 +2819,7 @@ DwBodyPart * KMMessage::getFirstDwBodyPart() const int KMMessage::partNumber( DwBodyPart * aDwBodyPart ) const { DwBodyPart *curpart; - QPtrList< DwBodyPart > parts; + TQPtrList< DwBodyPart > parts; int curIdx = 0; int idx = 0; // Get the DwBodyPart for this index @@ -2859,7 +2859,7 @@ int KMMessage::partNumber( DwBodyPart * aDwBodyPart ) const DwBodyPart * KMMessage::dwBodyPart( int aIdx ) const { DwBodyPart *part, *curpart; - QPtrList< DwBodyPart > parts; + TQPtrList< DwBodyPart > parts; int curIdx = 0; // Get the DwBodyPart for this index @@ -2899,7 +2899,7 @@ DwBodyPart * KMMessage::dwBodyPart( int aIdx ) const DwBodyPart * KMMessage::findDwBodyPart( int type, int subtype ) const { DwBodyPart *part, *curpart; - QPtrList< DwBodyPart > parts; + TQPtrList< DwBodyPart > parts; // Get the DwBodyPart for this index curpart = getFirstDwBodyPart(); @@ -2945,10 +2945,10 @@ DwBodyPart * KMMessage::findDwBodyPart( int type, int subtype ) const } //----------------------------------------------------------------------------- -DwBodyPart * KMMessage::findDwBodyPart( const QCString& type, const QCString& subtype ) const +DwBodyPart * KMMessage::findDwBodyPart( const TQCString& type, const TQCString& subtype ) const { DwBodyPart *part, *curpart; - QPtrList< DwBodyPart > parts; + TQPtrList< DwBodyPart > parts; // Get the DwBodyPart for this index curpart = getFirstDwBodyPart(); @@ -3006,7 +3006,7 @@ void applyHeadersToMessagePart( DwHeaders& headers, KMMessagePart* aPart ) // KMMsgPart::fileName; Name however is decoded here and stored as a // decoded String in KMMsgPart... // Content-type - QCString additionalCTypeParams; + TQCString additionalCTypeParams; if (headers.HasContentType()) { DwMediaType& ct = headers.ContentType(); @@ -3017,7 +3017,7 @@ void applyHeadersToMessagePart( DwHeaders& headers, KMMessagePart* aPart ) while(param) { if (!qstricmp(param->Attribute().c_str(), "charset")) - aPart->setCharset(QCString(param->Value().c_str()).lower()); + aPart->setCharset(TQCString(param->Value().c_str()).lower()); else if (!qstrnicmp(param->Attribute().c_str(), "name*", 5)) aPart->setName(KMMsgBase::decodeRFC2231String(KMMsgBase::extractRFC2231HeaderField( param->Value().c_str(), "name" ))); else { @@ -3078,7 +3078,7 @@ void KMMessage::bodyPart(DwBodyPart* aDwBodyPart, KMMessagePart* aPart, // spurious empty Subject: line in some of the parts. //aPart->setName(" "); // partSpecifier - QString partId( aDwBodyPart->partId() ); + TQString partId( aDwBodyPart->partId() ); aPart->setPartSpecifier( partId ); DwHeaders& headers = aDwBodyPart->Headers(); @@ -3088,11 +3088,11 @@ void KMMessage::bodyPart(DwBodyPart* aDwBodyPart, KMMessagePart* aPart, if (withBody) aPart->setBody( aDwBodyPart->Body().AsString() ); else - aPart->setBody( QCString("") ); + aPart->setBody( TQCString("") ); // Content-id if ( headers.HasContentId() ) { - const QCString contentId = headers.ContentId().AsString().c_str(); + const TQCString contentId = headers.ContentId().AsString().c_str(); // ignore leading '<' and trailing '>' aPart->setContentId( contentId.mid( 1, contentId.length() - 2 ) ); } @@ -3109,7 +3109,7 @@ void KMMessage::bodyPart(DwBodyPart* aDwBodyPart, KMMessagePart* aPart, //aPart->setName(" "); aPart->setContentDescription(""); aPart->setContentDisposition(""); - aPart->setBody(QCString("")); + aPart->setBody(TQCString("")); aPart->setContentId(""); } } @@ -3144,17 +3144,17 @@ DwBodyPart* KMMessage::createDWBodyPart(const KMMessagePart* aPart) if ( !aPart ) return part; - QCString charset = aPart->charset(); - QCString type = aPart->typeStr(); - QCString subtype = aPart->subtypeStr(); - QCString cte = aPart->cteStr(); - QCString contDesc = aPart->contentDescriptionEncoded(); - QCString contDisp = aPart->contentDisposition(); - QCString encoding = autoDetectCharset(charset, sPrefCharsets, aPart->name()); + TQCString charset = aPart->charset(); + TQCString type = aPart->typeStr(); + TQCString subtype = aPart->subtypeStr(); + TQCString cte = aPart->cteStr(); + TQCString contDesc = aPart->contentDescriptionEncoded(); + TQCString contDisp = aPart->contentDisposition(); + TQCString encoding = autoDetectCharset(charset, sPrefCharsets, aPart->name()); if (encoding.isEmpty()) encoding = "utf-8"; - QCString name = KMMsgBase::encodeRFC2231String(aPart->name(), encoding); - bool RFC2231encoded = aPart->name() != QString(name); - QCString paramAttr = aPart->parameterAttribute(); + TQCString name = KMMsgBase::encodeRFC2231String(aPart->name(), encoding); + bool RFC2231encoded = aPart->name() != TQString(name); + TQCString paramAttr = aPart->parameterAttribute(); DwHeaders& headers = part->Headers(); @@ -3172,10 +3172,10 @@ DwBodyPart* KMMessage::createDWBodyPart(const KMMessagePart* aPart) } } - QCString additionalParam = aPart->additionalCTypeParamStr(); + TQCString additionalParam = aPart->additionalCTypeParamStr(); if( !additionalParam.isEmpty() ) { - QCString parAV; + TQCString parAV; DwString parA, parV; int iL, i1, i2, iM; iL = additionalParam.length(); @@ -3229,14 +3229,14 @@ DwBodyPart* KMMessage::createDWBodyPart(const KMMessagePart* aPart) if (!paramAttr.isEmpty()) { - QCString encoding = autoDetectCharset(charset, sPrefCharsets, + TQCString encoding = autoDetectCharset(charset, sPrefCharsets, aPart->parameterValue()); if (encoding.isEmpty()) encoding = "utf-8"; - QCString paramValue; + TQCString paramValue; paramValue = KMMsgBase::encodeRFC2231String(aPart->parameterValue(), encoding); DwParameter *param = new DwParameter; - if (aPart->parameterValue() != QString(paramValue)) + if (aPart->parameterValue() != TQString(paramValue)) { param->SetAttribute((paramAttr + '*').data()); param->SetValue(paramValue.data(),true); @@ -3289,14 +3289,14 @@ void KMMessage::addBodyPart(const KMMessagePart* aPart) //----------------------------------------------------------------------------- -QString KMMessage::generateMessageId( const QString& addr ) +TQString KMMessage::generateMessageId( const TQString& addr ) { - QDateTime datetime = QDateTime::currentDateTime(); - QString msgIdStr; + TQDateTime datetime = TQDateTime::currentDateTime(); + TQString msgIdStr; msgIdStr = '<' + datetime.toString( "yyyyMMddhhmm.sszzz" ); - QString msgIdSuffix; + TQString msgIdSuffix; KConfigGroup general( KMKernel::config(), "General" ); if( general.readBoolEntry( "useCustomMessageIdSuffix", false ) ) @@ -3314,12 +3314,12 @@ QString KMMessage::generateMessageId( const QString& addr ) //----------------------------------------------------------------------------- -QCString KMMessage::html2source( const QCString & src ) +TQCString KMMessage::html2source( const TQCString & src ) { - QCString result( 1 + 6*(src.size()-1) ); // maximal possible length + TQCString result( 1 + 6*(src.size()-1) ); // maximal possible length - QCString::ConstIterator s = src.begin(); - QCString::Iterator d = result.begin(); + TQCString::ConstIterator s = src.begin(); + TQCString::Iterator d = result.begin(); while ( *s ) { switch ( *s ) { case '<': { @@ -3387,10 +3387,10 @@ QCString KMMessage::html2source( const QCString & src ) } //----------------------------------------------------------------------------- -QString KMMessage::encodeMailtoUrl( const QString& str ) +TQString KMMessage::encodeMailtoUrl( const TQString& str ) { - QString result; - result = QString::fromLatin1( KMMsgBase::encodeRFC2047String( str, + TQString result; + result = TQString::fromLatin1( KMMsgBase::encodeRFC2047String( str, "utf-8" ) ); result = KURL::encode_string( result ); return result; @@ -3398,9 +3398,9 @@ QString KMMessage::encodeMailtoUrl( const QString& str ) //----------------------------------------------------------------------------- -QString KMMessage::decodeMailtoUrl( const QString& url ) +TQString KMMessage::decodeMailtoUrl( const TQString& url ) { - QString result; + TQString result; result = KURL::decode_string( url ); result = KMMsgBase::decodeRFC2047String( result.latin1() ); return result; @@ -3408,22 +3408,22 @@ QString KMMessage::decodeMailtoUrl( const QString& url ) //----------------------------------------------------------------------------- -QCString KMMessage::stripEmailAddr( const QCString& aStr ) +TQCString KMMessage::stripEmailAddr( const TQCString& aStr ) { //kdDebug(5006) << "KMMessage::stripEmailAddr( " << aStr << " )" << endl; if ( aStr.isEmpty() ) - return QCString(); + return TQCString(); - QCString result; + TQCString result; // The following is a primitive parser for a mailbox-list (cf. RFC 2822). // The purpose is to extract a displayable string from the mailboxes. // Comments in the addr-spec are not handled. No error checking is done. - QCString name; - QCString comment; - QCString angleAddress; + TQCString name; + TQCString comment; + TQCString angleAddress; enum { TopLevel, InComment, InAngleAddress } context = TopLevel; bool inQuotedString = false; int commentLevel = 0; @@ -3481,9 +3481,9 @@ QCString KMMessage::stripEmailAddr( const QCString& aStr ) else if ( !angleAddress.isEmpty() ) { result += angleAddress; } - name = QCString(); - comment = QCString(); - angleAddress = QCString(); + name = TQCString(); + comment = TQCString(); + angleAddress = TQCString(); } else name += *p; @@ -3567,27 +3567,27 @@ QCString KMMessage::stripEmailAddr( const QCString& aStr ) } //----------------------------------------------------------------------------- -QString KMMessage::stripEmailAddr( const QString& aStr ) +TQString KMMessage::stripEmailAddr( const TQString& aStr ) { //kdDebug(5006) << "KMMessage::stripEmailAddr( " << aStr << " )" << endl; if ( aStr.isEmpty() ) - return QString::null; + return TQString::null; - QString result; + TQString result; // The following is a primitive parser for a mailbox-list (cf. RFC 2822). // The purpose is to extract a displayable string from the mailboxes. // Comments in the addr-spec are not handled. No error checking is done. - QString name; - QString comment; - QString angleAddress; + TQString name; + TQString comment; + TQString angleAddress; enum { TopLevel, InComment, InAngleAddress } context = TopLevel; bool inQuotedString = false; int commentLevel = 0; - QChar ch; + TQChar ch; unsigned int strLength(aStr.length()); for ( uint index = 0; index < strLength; ++index ) { ch = aStr[index]; @@ -3643,9 +3643,9 @@ QString KMMessage::stripEmailAddr( const QString& aStr ) else if ( !angleAddress.isEmpty() ) { result += angleAddress; } - name = QString::null; - comment = QString::null; - angleAddress = QString::null; + name = TQString::null; + comment = TQString::null; + angleAddress = TQString::null; } else name += ch; @@ -3729,9 +3729,9 @@ QString KMMessage::stripEmailAddr( const QString& aStr ) } //----------------------------------------------------------------------------- -QString KMMessage::quoteHtmlChars( const QString& str, bool removeLineBreaks ) +TQString KMMessage::quoteHtmlChars( const TQString& str, bool removeLineBreaks ) { - QString result; + TQString result; unsigned int strLength(str.length()); result.reserve( 6*strLength ); // maximal possible length @@ -3765,20 +3765,20 @@ QString KMMessage::quoteHtmlChars( const QString& str, bool removeLineBreaks ) } //----------------------------------------------------------------------------- -QString KMMessage::emailAddrAsAnchor(const QString& aEmail, bool stripped, const QString& cssStyle, bool aLink) +TQString KMMessage::emailAddrAsAnchor(const TQString& aEmail, bool stripped, const TQString& cssStyle, bool aLink) { if( aEmail.isEmpty() ) return aEmail; - QStringList addressList = KPIM::splitEmailAddrList( aEmail ); + TQStringList addressList = KPIM::splitEmailAddrList( aEmail ); - QString result; + TQString result; - for( QStringList::ConstIterator it = addressList.begin(); + for( TQStringList::ConstIterator it = addressList.begin(); ( it != addressList.end() ); ++it ) { if( !(*it).isEmpty() ) { - QString address = *it; + TQString address = *it; if(aLink) { result += "<a href=\"mailto:" + KMMessage::encodeMailtoUrl( address ) @@ -3803,12 +3803,12 @@ QString KMMessage::emailAddrAsAnchor(const QString& aEmail, bool stripped, const //----------------------------------------------------------------------------- //static -QStringList KMMessage::stripAddressFromAddressList( const QString& address, - const QStringList& list ) +TQStringList KMMessage::stripAddressFromAddressList( const TQString& address, + const TQStringList& list ) { - QStringList addresses( list ); - QString addrSpec( KPIM::getEmailAddress( address ) ); - for ( QStringList::Iterator it = addresses.begin(); + TQStringList addresses( list ); + TQString addrSpec( KPIM::getEmailAddress( address ) ); + for ( TQStringList::Iterator it = addresses.begin(); it != addresses.end(); ) { if ( kasciistricmp( addrSpec.utf8().data(), KPIM::getEmailAddress( *it ).utf8().data() ) == 0 ) { @@ -3825,10 +3825,10 @@ QStringList KMMessage::stripAddressFromAddressList( const QString& address, //----------------------------------------------------------------------------- //static -QStringList KMMessage::stripMyAddressesFromAddressList( const QStringList& list ) +TQStringList KMMessage::stripMyAddressesFromAddressList( const TQStringList& list ) { - QStringList addresses = list; - for( QStringList::Iterator it = addresses.begin(); + TQStringList addresses = list; + for( TQStringList::Iterator it = addresses.begin(); it != addresses.end(); ) { kdDebug(5006) << "Check whether " << *it << " is one of my addresses" << endl; @@ -3846,11 +3846,11 @@ QStringList KMMessage::stripMyAddressesFromAddressList( const QStringList& list //----------------------------------------------------------------------------- //static -bool KMMessage::addressIsInAddressList( const QString& address, - const QStringList& addresses ) +bool KMMessage::addressIsInAddressList( const TQString& address, + const TQStringList& addresses ) { - QString addrSpec = KPIM::getEmailAddress( address ); - for( QStringList::ConstIterator it = addresses.begin(); + TQString addrSpec = KPIM::getEmailAddress( address ); + for( TQStringList::ConstIterator it = addresses.begin(); it != addresses.end(); ++it ) { if ( kasciistricmp( addrSpec.utf8().data(), KPIM::getEmailAddress( *it ).utf8().data() ) == 0 ) @@ -3862,29 +3862,29 @@ bool KMMessage::addressIsInAddressList( const QString& address, //----------------------------------------------------------------------------- //static -QString KMMessage::expandAliases( const QString& recipients ) +TQString KMMessage::expandAliases( const TQString& recipients ) { if ( recipients.isEmpty() ) - return QString(); + return TQString(); - QStringList recipientList = KPIM::splitEmailAddrList( recipients ); + TQStringList recipientList = KPIM::splitEmailAddrList( recipients ); - QString expandedRecipients; - for ( QStringList::Iterator it = recipientList.begin(); + TQString expandedRecipients; + for ( TQStringList::Iterator it = recipientList.begin(); it != recipientList.end(); ++it ) { if ( !expandedRecipients.isEmpty() ) expandedRecipients += ", "; - QString receiver = (*it).stripWhiteSpace(); + TQString receiver = (*it).stripWhiteSpace(); // try to expand distribution list - QString expandedList = KAddrBookExternal::expandDistributionList( receiver ); + TQString expandedList = KAddrBookExternal::expandDistributionList( receiver ); if ( !expandedList.isEmpty() ) { expandedRecipients += expandedList; continue; } // try to expand nick name - QString expandedNickName = KabcBridge::expandNickName( receiver ); + TQString expandedNickName = KabcBridge::expandNickName( receiver ); if ( !expandedNickName.isEmpty() ) { expandedRecipients += expandedNickName; continue; @@ -3894,7 +3894,7 @@ QString KMMessage::expandAliases( const QString& recipients ) // FIXME: looking for '@' might be wrong if ( receiver.find('@') == -1 ) { KConfigGroup general( KMKernel::config(), "General" ); - QString defaultdomain = general.readEntry( "Default domain" ); + TQString defaultdomain = general.readEntry( "Default domain" ); if( !defaultdomain.isEmpty() ) { expandedRecipients += receiver + "@" + defaultdomain; } @@ -3912,10 +3912,10 @@ QString KMMessage::expandAliases( const QString& recipients ) //----------------------------------------------------------------------------- //static -QString KMMessage::guessEmailAddressFromLoginName( const QString& loginName ) +TQString KMMessage::guessEmailAddressFromLoginName( const TQString& loginName ) { if ( loginName.isEmpty() ) - return QString(); + return TQString(); char hostnameC[256]; // null terminate this C string @@ -3923,15 +3923,15 @@ QString KMMessage::guessEmailAddressFromLoginName( const QString& loginName ) // set the string to 0 length if gethostname fails if ( gethostname( hostnameC, 255 ) ) hostnameC[0] = '\0'; - QString address = loginName; + TQString address = loginName; address += '@'; - address += QString::fromLocal8Bit( hostnameC ); + address += TQString::fromLocal8Bit( hostnameC ); // try to determine the real name const KUser user( loginName ); if ( user.isValid() ) { - QString fullName = user.fullName(); - if ( fullName.find( QRegExp( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ) ) != -1 ) + TQString fullName = user.fullName(); + if ( fullName.find( TQRegExp( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ) ) != -1 ) address = '"' + fullName.replace( '\\', "\\" ).replace( '"', "\\" ) + "\" <" + address + '>'; else @@ -3954,7 +3954,7 @@ void KMMessage::readConfig() int languageNr = config->readNumEntry("reply-current-language",0); { // area for config group "KMMessage #n" - KConfigGroupSaver saver(config, QString("KMMessage #%1").arg(languageNr)); + KConfigGroupSaver saver(config, TQString("KMMessage #%1").arg(languageNr)); sReplyLanguage = config->readEntry("language",KGlobal::locale()->language()); sReplyStr = config->readEntry("phrase-reply", i18n("On %D, you wrote:")); @@ -3984,15 +3984,15 @@ void KMMessage::readConfig() } } -QCString KMMessage::defaultCharset() +TQCString KMMessage::defaultCharset() { - QCString retval; + TQCString retval; if (!sPrefCharsets.isEmpty()) retval = sPrefCharsets[0].latin1(); if (retval.isEmpty() || (retval == "locale")) { - retval = QCString(kmkernel->networkCodec()->mimeName()); + retval = TQCString(kmkernel->networkCodec()->mimeName()); KPIM::kAsciiToLower( retval.data() ); } @@ -4001,13 +4001,13 @@ QCString KMMessage::defaultCharset() return retval; } -const QStringList &KMMessage::preferredCharsets() +const TQStringList &KMMessage::preferredCharsets() { return sPrefCharsets; } //----------------------------------------------------------------------------- -QCString KMMessage::charset() const +TQCString KMMessage::charset() const { if ( mMsg->Headers().HasContentType() ) { DwMediaType &mType=mMsg->Headers().ContentType(); @@ -4023,7 +4023,7 @@ QCString KMMessage::charset() const } //----------------------------------------------------------------------------- -void KMMessage::setCharset(const QCString& bStr) +void KMMessage::setCharset(const TQCString& bStr) { kdWarning( type() != DwMime::kTypeText ) << "KMMessage::setCharset(): trying to set a charset for a non-textual mimetype." << endl @@ -4031,7 +4031,7 @@ void KMMessage::setCharset(const QCString& bStr) << "====================================================================" << endl << kdBacktrace( 5 ) << endl << "====================================================================" << endl; - QCString aStr = bStr; + TQCString aStr = bStr; KPIM::kAsciiToLower( aStr.data() ); DwMediaType &mType = dwContentType(); mType.Parse(); @@ -4095,14 +4095,14 @@ void KMMessage::link( const KMMessage *aMsg, KMMsgStatus aStatus ) || aStatus == KMMsgStatusForwarded || aStatus == KMMsgStatusDeleted ); - QString message = headerField( "X-KMail-Link-Message" ); + TQString message = headerField( "X-KMail-Link-Message" ); if ( !message.isEmpty() ) message += ','; - QString type = headerField( "X-KMail-Link-Type" ); + TQString type = headerField( "X-KMail-Link-Type" ); if ( !type.isEmpty() ) type += ','; - message += QString::number( aMsg->getMsgSerNum() ); + message += TQString::number( aMsg->getMsgSerNum() ); if ( aStatus == KMMsgStatusReplied ) type += "reply"; else if ( aStatus == KMMsgStatusForwarded ) @@ -4120,8 +4120,8 @@ void KMMessage::getLink(int n, ulong *retMsgSerNum, KMMsgStatus *retStatus) cons *retMsgSerNum = 0; *retStatus = KMMsgStatusUnknown; - QString message = headerField("X-KMail-Link-Message"); - QString type = headerField("X-KMail-Link-Type"); + TQString message = headerField("X-KMail-Link-Message"); + TQString type = headerField("X-KMail-Link-Type"); message = message.section(',', n, n); type = type.section(',', n, n); @@ -4137,7 +4137,7 @@ void KMMessage::getLink(int n, ulong *retMsgSerNum, KMMsgStatus *retStatus) cons } //----------------------------------------------------------------------------- -DwBodyPart* KMMessage::findDwBodyPart( DwBodyPart* part, const QString & partSpecifier ) +DwBodyPart* KMMessage::findDwBodyPart( DwBodyPart* part, const TQString & partSpecifier ) { if ( !part ) return 0; DwBodyPart* current; @@ -4169,7 +4169,7 @@ DwBodyPart* KMMessage::findDwBodyPart( DwBodyPart* part, const QString & partSpe } //----------------------------------------------------------------------------- -void KMMessage::updateBodyPart(const QString partSpecifier, const QByteArray & data) +void KMMessage::updateBodyPart(const TQString partSpecifier, const TQByteArray & data) { if ( !data.data() || !data.size() ) return; @@ -4179,7 +4179,7 @@ void KMMessage::updateBodyPart(const QString partSpecifier, const QByteArray & d partSpecifier != "0" && partSpecifier != "TEXT" ) { - QString specifier = partSpecifier; + TQString specifier = partSpecifier; if ( partSpecifier.endsWith(".HEADER") || partSpecifier.endsWith(".MIME") ) { // get the parent bodypart @@ -4213,7 +4213,7 @@ void KMMessage::updateBodyPart(const QString partSpecifier, const QByteArray & d } else { // update body mLastUpdated->Body().FromString( content ); - QString parentSpec = partSpecifier.section( '.', 0, -2 ); + TQString parentSpec = partSpecifier.section( '.', 0, -2 ); if ( !parentSpec.isEmpty() ) { DwBodyPart* parent = findDwBodyPart( getFirstDwBodyPart(), parentSpec ); @@ -4312,19 +4312,19 @@ void KMMessage::updateAttachmentState( DwBodyPart* part ) setStatus( KMMsgStatusHasNoAttach ); } -void KMMessage::setBodyFromUnicode( const QString & str ) { - QCString encoding = KMMsgBase::autoDetectCharset( charset(), KMMessage::preferredCharsets(), str ); +void KMMessage::setBodyFromUnicode( const TQString & str ) { + TQCString encoding = KMMsgBase::autoDetectCharset( charset(), KMMessage::preferredCharsets(), str ); if ( encoding.isEmpty() ) encoding = "utf-8"; - const QTextCodec * codec = KMMsgBase::codecForName( encoding ); + const TQTextCodec * codec = KMMsgBase::codecForName( encoding ); assert( codec ); - QValueList<int> dummy; + TQValueList<int> dummy; setCharset( encoding ); setBodyAndGuessCte( codec->fromUnicode( str ), dummy, false /* no 8bit */ ); } -const QTextCodec * KMMessage::codec() const { - const QTextCodec * c = mOverrideCodec; +const TQTextCodec * KMMessage::codec() const { + const TQTextCodec * c = mOverrideCodec; if ( !c ) // no override-codec set for this message, try the CT charset parameter: c = KMMsgBase::codecForName( charset() ); @@ -4341,7 +4341,7 @@ const QTextCodec * KMMessage::codec() const { return c; } -QString KMMessage::bodyToUnicode(const QTextCodec* codec) const { +TQString KMMessage::bodyToUnicode(const TQTextCodec* codec) const { if ( !codec ) // No codec was given, so try the charset in the mail codec = this->codec(); @@ -4351,12 +4351,12 @@ QString KMMessage::bodyToUnicode(const QTextCodec* codec) const { } //----------------------------------------------------------------------------- -QCString KMMessage::mboxMessageSeparator() +TQCString KMMessage::mboxMessageSeparator() { - QCString str( KPIM::getFirstEmailAddress( rawHeaderField("From") ) ); + TQCString str( KPIM::getFirstEmailAddress( rawHeaderField("From") ) ); if ( str.isEmpty() ) str = "unknown@unknown.invalid"; - QCString dateStr( dateShortStr() ); + TQCString dateStr( dateShortStr() ); if ( dateStr.isEmpty() ) { time_t t = ::time( 0 ); dateStr = ctime( &t ); |