diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kmail/objecttreeparser.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/objecttreeparser.cpp')
-rw-r--r-- | kmail/objecttreeparser.cpp | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/kmail/objecttreeparser.cpp b/kmail/objecttreeparser.cpp index 132dc058e..80c182d98 100644 --- a/kmail/objecttreeparser.cpp +++ b/kmail/objecttreeparser.cpp @@ -20,11 +20,11 @@ In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to + TQt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. @@ -97,7 +97,7 @@ #include <kiconloader.h> #include <kmdcodec.h> -// other Qt headers +// other TQt headers #include <tqtextcodec.h> #include <tqdir.h> #include <tqfile.h> @@ -208,24 +208,24 @@ namespace KMail { myBody->Headers().Parse(); } - partNode* parentNode = &startNode; + partNode* tqparentNode = &startNode; partNode* newNode = new partNode(false, myBody); - // Build the object tree of the new node before setting the parent, as otherwise - // buildObjectTree() would erronously modify the parents as well + // Build the object tree of the new node before setting the tqparent, as otherwise + // buildObjectTree() would erronously modify the tqparents as well newNode->buildObjectTree( false ); - if ( append && parentNode->firstChild() ) { - parentNode = parentNode->firstChild(); - while( parentNode->nextSibling() ) - parentNode = parentNode->nextSibling(); - parentNode->setNext( newNode ); + if ( append && tqparentNode->firstChild() ) { + tqparentNode = tqparentNode->firstChild(); + while( tqparentNode->nextSibling() ) + tqparentNode = tqparentNode->nextSibling(); + tqparentNode->setNext( newNode ); } else - parentNode->setFirstChild( newNode ); + tqparentNode->setFirstChild( newNode ); if ( startNode.mimePartTreeItem() ) { newNode->fillMimePartTree( startNode.mimePartTreeItem(), 0, - TQString::null, TQString::null, TQString::null, 0, + TQString(), TQString(), TQString(), 0, append ); } else { } @@ -260,7 +260,7 @@ namespace KMail { node->setProcessed( false, false ); if ( partNode * child = node->firstChild() ) child->setProcessed( false, true ); - } else if ( mReader && !node->parentNode() ) { + } else if ( mReader && !node->tqparentNode() ) { // ...this node and all it's siblings and descendants node->setProcessed( false, true ); } @@ -338,7 +338,7 @@ namespace KMail { const AttachmentStrategy * as = attachmentStrategy(); if ( as && as->defaultDisplay( node ) == AttachmentStrategy::None && !showOnlyOneMimePart() && - node->parentNode() /* message is not an attachment */ ) { + node->tqparentNode() /* message is not an attachment */ ) { node->setDisplayedHidden( true ); return; } @@ -391,7 +391,7 @@ namespace KMail { ////////////////// ////////////////// - static int signatureToStatus( const GpgME::Signature &sig ) + static int signatureTotqStatus( const GpgME::Signature &sig ) { switch ( sig.status().code() ) { case GPG_ERR_NO_ERROR: @@ -461,7 +461,7 @@ namespace KMail { dumpToFile( "dat_01_reader_signedtext_before_canonicalization", cleartext.data(), cleartext.length() ); - // tqreplace simple LFs by CRLSs + // replace simple LFs by CRLSs // according to RfC 2633, 3.1.1 Canonicalization //kdDebug(5006) << "Converting LF to CRLF (see RfC 2633, 3.1.1 Canonicalization)" << endl; cleartext = Util::lf2crlf( cleartext ); @@ -586,10 +586,10 @@ namespace KMail { //kdDebug(5006) << "\nObjectTreeParser::writeOpaqueOrMultipartSignedData: found signature" << endl; GpgME::Signature signature = signatures[0]; - messagePart.status_code = signatureToStatus( signature ); + messagePart.status_code = signatureTotqStatus( signature ); messagePart.status = TQString::fromUtf8( signature.status().asString() ); for ( uint i = 1; i < signatures.size(); ++i ) { - if ( signatureToStatus( signatures[i] ) != messagePart.status_code ) { + if ( signatureTotqStatus( signatures[i] ) != messagePart.status_code ) { messagePart.status_code = GPGME_SIG_STAT_DIFF; messagePart.status = i18n("Different results for signatures"); } @@ -667,7 +667,7 @@ namespace KMail { txt.append( i18n( "The crypto engine returned no cleartext data." ) ); txt.append( "</h2></b>" ); txt.append( "<br> <br>" ); - txt.append( i18n( "Status: " ) ); + txt.append( i18n( "tqStatus: " ) ); if ( !messagePart.status.isEmpty() ) { txt.append( "<i>" ); txt.append( messagePart.status ); @@ -785,9 +785,9 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data, { passphraseError = false; decryptionStarted = false; - aErrorText = TQString::null; + aErrorText = TQString(); auditLogError = GpgME::Error(); - auditLog = TQString::null; + auditLog = TQString(); bool bDecryptionOk = false; enum { NO_PLUGIN, NOT_INITIALIZED, CANT_DECRYPT } cryptPlugError = NO_PLUGIN; @@ -804,9 +804,9 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data, TQByteArray ciphertext( data.msgPart().bodyDecodedBinary() ); #ifdef MARCS_DEBUG TQCString cipherStr( ciphertext.data(), ciphertext.size() + 1 ); - bool cipherIsBinary = (-1 == cipherStr.find("BEGIN ENCRYPTED MESSAGE", 0, false) ) && - (-1 == cipherStr.find("BEGIN PGP ENCRYPTED MESSAGE", 0, false) ) && - (-1 == cipherStr.find("BEGIN PGP MESSAGE", 0, false) ); + bool cipherIsBinary = (-1 == cipherStr.tqfind("BEGIN ENCRYPTED MESSAGE", 0, false) ) && + (-1 == cipherStr.tqfind("BEGIN PGP ENCRYPTED MESSAGE", 0, false) ) && + (-1 == cipherStr.tqfind("BEGIN PGP MESSAGE", 0, false) ); dumpToFile( "dat_04_reader.encrypted", ciphertext.data(), ciphertext.size() ); @@ -829,7 +829,7 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data, if ( mReader ) emit mReader->noDrag(); // in case pineentry pops up, don't let kmheaders start a drag afterwards - // Check whether the memento tqcontains a result from last time: + // Check whether the memento contains a result from last time: const DecryptVerifyBodyPartMemento * m = dynamic_cast<DecryptVerifyBodyPartMemento*>( data.bodyPartMemento( "decryptverify" ) ); if ( !m ) { @@ -916,9 +916,9 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data, // ### while pinentry-qt appears) TQByteArray ciphertext( data.msgPart().bodyDecodedBinary() ); TQCString cipherStr( ciphertext.data(), ciphertext.size() + 1 ); - bool cipherIsBinary = (-1 == cipherStr.find("BEGIN ENCRYPTED MESSAGE", 0, false) ) && - (-1 == cipherStr.find("BEGIN PGP ENCRYPTED MESSAGE", 0, false) ) && - (-1 == cipherStr.find("BEGIN PGP MESSAGE", 0, false) ); + bool cipherIsBinary = (-1 == cipherStr.tqfind("BEGIN ENCRYPTED MESSAGE", 0, false) ) && + (-1 == cipherStr.tqfind("BEGIN PGP ENCRYPTED MESSAGE", 0, false) ) && + (-1 == cipherStr.tqfind("BEGIN PGP MESSAGE", 0, false) ); if ( !cipherIsBinary ) { decryptedData = cipherStr; } @@ -936,10 +936,10 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data, } //static - bool ObjectTreeParser::tqcontainsExternalReferences( const TQCString & str ) + bool ObjectTreeParser::containsExternalReferences( const TQCString & str ) { TQRegExp httpRegExp("(\\\"|\\\'|url\\s*\\(\\s*)http[s]?:"); - int httpPos = str.find( httpRegExp, 0 ); + int httpPos = str.tqfind( httpRegExp, 0 ); while ( httpPos >= 0 ) { // look backwards for "href" @@ -952,7 +952,7 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data, return true; } // find next occurrence of "http: or "https: - httpPos = str.find( httpRegExp, httpPos + 6 ); + httpPos = str.tqfind( httpRegExp, httpPos + 6 ); } return false; } @@ -990,12 +990,12 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data, // ---Sven's strip </BODY> and </HTML> from end of attachment end- // Show the "external references" warning (with possibility to load // external references only if loading external references is disabled - // and the HTML code tqcontains obvious external references). For + // and the HTML code contains obvious external references). For // messages where the external references are obfuscated the user won't // have an easy way to load them but that shouldn't be a problem - // because only spam tqcontains obfuscated external references. + // because only spam contains obfuscated external references. if ( !mReader->htmlLoadExternal() && - tqcontainsExternalReferences( cstr ) ) { + containsExternalReferences( cstr ) ) { htmlWriter()->queue( "<div class=\"htmlWarn\">\n" ); htmlWriter()->queue( i18n("<b>Note:</b> This HTML message may contain external " "references to images etc. For security/privacy reasons " @@ -1031,7 +1031,7 @@ static bool isMailmanMessage( partNode * curNode ) { return true; if ( headers.HasField("X-Mailer") && 0 == TQCString( headers.FieldBody("X-Mailer").AsString().c_str() ) - .find("MAILMAN", 0, false) ) + .tqfind("MAILMAN", 0, false) ) return true; return false; } @@ -1047,21 +1047,21 @@ namespace KMail { const TQCString delimZ2("--__--__--\n\n_____________"); const TQCString delimZ1("--__--__--\r\n\r\n_____________"); TQCString partStr, digestHeaderStr; - int thisDelim = cstr.find(delim1, 0, false); + int thisDelim = cstr.tqfind(delim1, 0, false); if ( thisDelim == -1 ) - thisDelim = cstr.find(delim2, 0, false); + thisDelim = cstr.tqfind(delim2, 0, false); if ( thisDelim == -1 ) { kdDebug(5006) << " Sorry: Old style Mailman message but no delimiter found." << endl; return false; } - int nextDelim = cstr.find(delim1, thisDelim+1, false); + int nextDelim = cstr.tqfind(delim1, thisDelim+1, false); if ( -1 == nextDelim ) - nextDelim = cstr.find(delim2, thisDelim+1, false); + nextDelim = cstr.tqfind(delim2, thisDelim+1, false); if ( -1 == nextDelim ) - nextDelim = cstr.find(delimZ1, thisDelim+1, false); + nextDelim = cstr.tqfind(delimZ1, thisDelim+1, false); if ( -1 == nextDelim ) - nextDelim = cstr.find(delimZ2, thisDelim+1, false); + nextDelim = cstr.tqfind(delimZ2, thisDelim+1, false); if ( nextDelim < 0) return false; @@ -1081,15 +1081,15 @@ namespace KMail { curNode->setType( DwMime::kTypeMultipart ); curNode->setSubType( DwMime::kSubtypeDigest ); while( -1 < nextDelim ){ - int thisEoL = cstr.find("\nMessage:", thisDelim, false); + int thisEoL = cstr.tqfind("\nMessage:", thisDelim, false); if ( -1 < thisEoL ) thisDelim = thisEoL+1; else{ - thisEoL = cstr.find("\n_____________", thisDelim, false); + thisEoL = cstr.tqfind("\n_____________", thisDelim, false); if ( -1 < thisEoL ) thisDelim = thisEoL+1; } - thisEoL = cstr.find('\n', thisDelim); + thisEoL = cstr.tqfind('\n', thisDelim); if ( -1 < thisEoL ) thisDelim = thisEoL+1; else @@ -1101,10 +1101,10 @@ namespace KMail { partStr += cstr.mid( thisDelim, nextDelim-thisDelim ); TQCString subject("embedded message"); TQCString subSearch("\nSubject:"); - int subPos = partStr.find(subSearch, 0, false); + int subPos = partStr.tqfind(subSearch, 0, false); if ( -1 < subPos ){ subject = partStr.mid(subPos+subSearch.length()); - thisEoL = subject.find('\n'); + thisEoL = subject.tqfind('\n'); if ( -1 < thisEoL ) subject.truncate( thisEoL ); } @@ -1114,21 +1114,21 @@ namespace KMail { subject, true ); //mReader->queueHtml("<br><hr><br>"); thisDelim = nextDelim+1; - nextDelim = cstr.find(delim1, thisDelim, false); + nextDelim = cstr.tqfind(delim1, thisDelim, false); if ( -1 == nextDelim ) - nextDelim = cstr.find(delim2, thisDelim, false); + nextDelim = cstr.tqfind(delim2, thisDelim, false); if ( -1 == nextDelim ) - nextDelim = cstr.find(delimZ1, thisDelim, false); + nextDelim = cstr.tqfind(delimZ1, thisDelim, false); if ( -1 == nextDelim ) - nextDelim = cstr.find(delimZ2, thisDelim, false); + nextDelim = cstr.tqfind(delimZ2, thisDelim, false); } // reset curent node's Content-Type curNode->setType( DwMime::kTypeText ); curNode->setSubType( DwMime::kSubtypePlain ); - int thisEoL = cstr.find("_____________", thisDelim); + int thisEoL = cstr.tqfind("_____________", thisDelim); if ( -1 < thisEoL ){ thisDelim = thisEoL; - thisEoL = cstr.find('\n', thisDelim); + thisEoL = cstr.tqfind('\n', thisDelim); if ( -1 < thisEoL ) thisDelim = thisEoL+1; } @@ -1357,7 +1357,7 @@ namespace KMail { const Kleo::CryptoBackend::Protocol * useThisCryptProto = 0; /* - ATTENTION: This code is to be tqreplaced by the new 'auto-detect' feature. -------------------------------------- + ATTENTION: This code is to be replaced by the new 'auto-detect' feature. -------------------------------------- */ partNode * data = child->findType( DwMime::kTypeApplication, DwMime::kSubtypeOctetStream, false, true ); @@ -1544,9 +1544,9 @@ namespace KMail { } const Kleo::CryptoBackend::Protocol* oldUseThisCryptPlug = cryptoProtocol(); - if ( node->parentNode() - && DwMime::kTypeMultipart == node->parentNode()->type() - && DwMime::kSubtypeEncrypted == node->parentNode()->subType() ) { + if ( node->tqparentNode() + && DwMime::kTypeMultipart == node->tqparentNode()->type() + && DwMime::kSubtypeEncrypted == node->tqparentNode()->subType() ) { //kdDebug(5006) << "\n-----> Initially processing encrypted data\n" << endl; node->setEncryptionState( KMMsgFullyEncrypted ); if ( keepEncryptions() ) { @@ -1559,7 +1559,7 @@ namespace KMail { writeDeferredDecryptionBlock(); } else { /* - ATTENTION: This code is to be tqreplaced by the planned 'auto-detect' feature. + ATTENTION: This code is to be replaced by the planned 'auto-detect' feature. */ PartMetaData messagePart; setCryptoProtocol( Kleo::CryptoBackendFactory::instance()->openpgp() ); @@ -1720,7 +1720,7 @@ namespace KMail { bool isSigned = smimeType == "signed-data"; bool isEncrypted = smimeType == "enveloped-data"; - // Analyze "signTestNode" node to find/verify a signature. + // Analyze "signTestNode" node to tqfind/verify a signature. // If zero this verification was successfully done after // decrypting via recursion by insertAndParseNewChildNode(). partNode* signTestNode = isEncrypted ? 0 : node; @@ -2050,7 +2050,7 @@ bool ObjectTreeParser::processApplicationMsTnefSubtype( partNode *node, ProcessR TQString comment = msgPart->contentDescription(); comment = KMMessage::quoteHtmlChars( comment, true ); - if ( label == comment ) comment = TQString::null; + if ( label == comment ) comment = TQString(); TQString fileName = mReader->writeMessagePartToTempFile( msgPart, partNum ); @@ -2252,7 +2252,7 @@ TQString ObjectTreeParser::sigStatusToString( const Kleo::CryptoBackend::Protoco } /* // add i18n support for 3rd party plug-ins here: - else if (0 <= cryptPlug->libName().find( "yetanotherpluginname", 0, false )) { + else if (0 <= cryptPlug->libName().tqfind( "yetanotherpluginname", 0, false )) { } */ @@ -2320,7 +2320,7 @@ static TQString makeShowAuditLogLink( const GpgME::Error & err, const TQString & return "<a href=\"" + url.htmlURL() + "\">" + i18n("The Audit Log is a detailed error log from the gnupg backend", "Show Audit Log") + "</a>"; } - return TQString::null; + return TQString(); } static TQString endVerboseSigstatHeader( const PartMetaData & pmd ) @@ -2492,7 +2492,7 @@ TQString ObjectTreeParser::writeSigstatHeader( PartMetaData & block, msgFrom + "<br />" + i18n("stored: "); - // We cannot use Qt's join() function here but + // We cannot use TQt's join() function here but // have to join the addresses manually to // extract the mail addresses (without '<''>') // before including it into our string: @@ -2591,7 +2591,7 @@ TQString ObjectTreeParser::writeSigstatHeader( PartMetaData & block, htmlStr += "<br />"; if( !statusStr.isEmpty() ) { htmlStr += " <br />"; - htmlStr += i18n( "Status: " ); + htmlStr += i18n( "tqStatus: " ); htmlStr += statusStr; } } else { @@ -2634,7 +2634,7 @@ TQString ObjectTreeParser::writeSigstatHeader( PartMetaData & block, "verified." ); if( !statusStr.isEmpty() ) { htmlStr += "<br />"; - htmlStr += i18n( "Status: " ); + htmlStr += i18n( "tqStatus: " ); htmlStr += "<i>"; htmlStr += statusStr; htmlStr += "</i>"; @@ -2795,7 +2795,7 @@ void ObjectTreeParser::writeBodyStr( const TQCString& aStr, const TQTextCodec *a bool goodSignature = false; Kpgp::Module* pgp = Kpgp::Module::getKpgp(); assert(pgp != 0); - bool isPgpMessage = false; // true if the message tqcontains at least one + bool isPgpMessage = false; // true if the message contains at least one // PGP MESSAGE or one PGP SIGNED MESSAGE block TQString dir = ( TQApplication::reverseLayout() ? "rtl" : "ltr" ); TQString headerStr = TQString("<div dir=\"%1\">").arg(dir); @@ -2982,7 +2982,7 @@ TQString ObjectTreeParser::quotedHTML( const TQString& s, bool decorate ) TQString line; /* search next occurrence of '\n' */ - pos = s.find('\n', beg, FALSE); + pos = s.tqfind('\n', beg, FALSE); if (pos == (unsigned int)(-1)) pos = length; |