From 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 13 Apr 2011 00:46:47 +0000 Subject: 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 --- kioslaves/imap4/imap4.cc | 122 +++++++++++++++--------------- kioslaves/imap4/imap4.h | 6 +- kioslaves/imap4/imapcommand.cc | 10 +-- kioslaves/imap4/imapcommand.h | 6 +- kioslaves/imap4/imapinfo.cc | 8 +- kioslaves/imap4/imaplist.cc | 14 ++-- kioslaves/imap4/imapparser.cc | 94 +++++++++++------------ kioslaves/imap4/imapparser.h | 22 +++--- kioslaves/imap4/mailaddress.cc | 14 ++-- kioslaves/imap4/mailheader.cc | 2 +- kioslaves/imap4/mimehdrline.cc | 8 +- kioslaves/imap4/mimehdrline.h | 4 +- kioslaves/imap4/mimeheader.cc | 52 ++++++------- kioslaves/imap4/mimeheader.h | 6 +- kioslaves/imap4/mimeio.cc | 22 +++--- kioslaves/imap4/mimeio.h | 12 +-- kioslaves/imap4/rfcdecoder.cc | 18 ++--- kioslaves/mbox/mboxfile.cc | 4 +- kioslaves/mbox/mboxfile.h | 6 +- kioslaves/mbox/readmbox.cc | 14 ++-- kioslaves/mbox/readmbox.h | 8 +- kioslaves/mbox/stat.cc | 2 +- kioslaves/mbox/urlinfo.cc | 2 +- kioslaves/mbox/urlinfo.h | 2 +- kioslaves/opengroupware/opengroupware.h | 1 + kioslaves/opengroupware/webdavhandler.cpp | 2 +- kioslaves/opengroupware/webdavhandler.h | 2 +- kioslaves/sieve/sieve.cpp | 24 +++--- kioslaves/sieve/sieve.h | 18 ++--- 29 files changed, 253 insertions(+), 252 deletions(-) (limited to 'kioslaves') diff --git a/kioslaves/imap4/imap4.cc b/kioslaves/imap4/imap4.cc index b5d1071f1..29ab5980a 100644 --- a/kioslaves/imap4/imap4.cc +++ b/kioslaves/imap4/imap4.cc @@ -228,11 +228,11 @@ IMAP4Protocol::get (const KURL & _url) // the logic is in the app. TQString aUpper = aSection.upper(); - if (aUpper.find ("STRUCTURE") != -1) + if (aUpper.tqfind ("STRUCTURE") != -1) { aSection = "BODYSTRUCTURE"; } - else if (aUpper.find ("ENVELOPE") != -1) + else if (aUpper.tqfind ("ENVELOPE") != -1) { aSection = "UID RFC822.SIZE FLAGS ENVELOPE"; if (hasCapability("IMAP4rev1")) { @@ -246,9 +246,9 @@ IMAP4Protocol::get (const KURL & _url) { aSection = "UID RFC822.HEADER RFC822.SIZE FLAGS"; } - else if (aUpper.find ("BODY.PEEK[") != -1) + else if (aUpper.tqfind ("BODY.PEEK[") != -1) { - if (aUpper.find ("BODY.PEEK[]") != -1) + if (aUpper.tqfind ("BODY.PEEK[]") != -1) { if (!hasCapability("IMAP4rev1")) // imap4 does not know BODY.PEEK[] aSection.tqreplace("BODY.PEEK[]", "RFC822.PEEK"); @@ -295,7 +295,7 @@ IMAP4Protocol::get (const KURL & _url) } } outputLine ("\r\n", 2); - flushOutput(TQString::null); + flushOutput(TQString()); cacheOutput = false; } @@ -342,11 +342,11 @@ IMAP4Protocol::get (const KURL & _url) if (cmd && !cmd->isComplete ()) { - if ((aUpper.find ("BODYSTRUCTURE") != -1) - || (aUpper.find ("FLAGS") != -1) - || (aUpper.find ("UID") != -1) - || (aUpper.find ("ENVELOPE") != -1) - || (aUpper.find ("BODY.PEEK[0]") != -1 + if ((aUpper.tqfind ("BODYSTRUCTURE") != -1) + || (aUpper.tqfind ("FLAGS") != -1) + || (aUpper.tqfind ("UID") != -1) + || (aUpper.tqfind ("ENVELOPE") != -1) + || (aUpper.tqfind ("BODY.PEEK[0]") != -1 && (aEnum == ITYPE_BOX || aEnum == ITYPE_DIR_AND_BOX))) { if (aEnum == ITYPE_BOX || aEnum == ITYPE_DIR_AND_BOX) @@ -440,8 +440,8 @@ IMAP4Protocol::listDir (const KURL & _url) UDSEntry entry; UDSAtom atom; KURL aURL = _url; - if (aURL.path().find(';') != -1) - aURL.setPath(aURL.path().left(aURL.path().find(';'))); + if (aURL.path().tqfind(';') != -1) + aURL.setPath(aURL.path().left(aURL.path().tqfind(';'))); kdDebug(7116) << "IMAP4Protocol::listDir - got " << listResponses.count () << endl; @@ -495,7 +495,7 @@ IMAP4Protocol::listDir (const KURL & _url) && myLType != "LIST" && myLType != "LSUB" && myLType != "LSUBNOCHECK") { KURL aURL = _url; - aURL.setQuery (TQString::null); + aURL.setQuery (TQString()); const TQString encodedUrl = aURL.url(0, 106); // utf-8 if (!_url.query ().isEmpty ()) @@ -588,7 +588,7 @@ IMAP4Protocol::listDir (const KURL & _url) bool withSubject = mySection.isEmpty(); if (mySection.isEmpty()) mySection = "UID RFC822.SIZE ENVELOPE"; - bool withFlags = mySection.upper().find("FLAGS") != -1; + bool withFlags = mySection.upper().tqfind("FLAGS") != -1; imapCommand *fetch = sendCommand (imapCommand:: clientFetch (mySequence, mySection)); @@ -670,7 +670,7 @@ bool IMAP4Protocol::parseRead(TQByteArray & buffer, ulong len, ulong relay) char buf[8192]; while (buffer.size() < len) { - ssize_t readLen = myRead(buf, QMIN(len - buffer.size(), sizeof(buf) - 1)); + ssize_t readLen = myRead(buf, TQMIN(len - buffer.size(), sizeof(buf) - 1)); if (readLen == 0) { kdDebug(7116) << "parseRead: readLen == 0 - connection broken" << endl; @@ -683,7 +683,7 @@ bool IMAP4Protocol::parseRead(TQByteArray & buffer, ulong len, ulong relay) { TQByteArray relayData; ssize_t relbuf = relay - buffer.size(); - int currentRelay = QMIN(relbuf, readLen); + int currentRelay = TQMIN(relbuf, readLen); relayData.setRawData(buf, currentRelay); parseRelay(relayData); relayData.resetRawData(buf, currentRelay); @@ -875,7 +875,7 @@ IMAP4Protocol::put (const KURL & _url, int, bool, bool) if (hasCapability("UIDPLUS")) { TQString uid = cmd->resultInfo(); - if (uid.find("APPENDUID") != -1) + if (uid.tqfind("APPENDUID") != -1) { uid = uid.section(" ", 2, 2); uid.truncate(uid.length()-1); @@ -930,7 +930,7 @@ IMAP4Protocol::mkdir (const KURL & _url, int) parseURL(_url, aBox, aSection, aLType, aSequence, aValidity, aDelimiter, aInfo); if (type == ITYPE_BOX) { - bool ask = ( aInfo.find( "ASKUSER" ) != -1 ); + bool ask = ( aInfo.tqfind( "ASKUSER" ) != -1 ); if ( ask && messageBox(QuestionYesNo, i18n("The following folder will be created on the server: %1 " @@ -972,7 +972,7 @@ IMAP4Protocol::copy (const KURL & src, const KURL & dest, int, bool overwrite) if (dType != ITYPE_BOX && dType != ITYPE_DIR_AND_BOX) { // this might be konqueror - int sub = dBox.find (sBox); + int sub = dBox.tqfind (sBox); // might be moving to upper folder if (sub > 0) @@ -1049,7 +1049,7 @@ IMAP4Protocol::copy (const KURL & src, const KURL & dest, int, bool overwrite) if (hasCapability("UIDPLUS")) { TQString uid = cmd->resultInfo(); - if (uid.find("COPYUID") != -1) + if (uid.tqfind("COPYUID") != -1) { uid = uid.section(" ", 2, 3); uid.truncate(uid.length()-1); @@ -1330,10 +1330,10 @@ IMAP4Protocol::special (const TQByteArray & aData) // quota int cmd; stream >> cmd; - if ( hasCapability( "QUOTA" ) ) { + if ( hasCapability( "TQUOTA" ) ) { specialQuotaCommand( cmd, stream ); } else { - error( ERR_UNSUPPORTED_ACTION, "QUOTA" ); + error( ERR_UNSUPPORTED_ACTION, "TQUOTA" ); } break; } @@ -1493,7 +1493,7 @@ IMAP4Protocol::specialACLCommand( int command, TQDataStream& stream ) } // Returning information to the application from a special() command isn't easy. // I'm reusing the infoMessage trick seen above (for capabilities), but this - // limits me to a string instead of a stringlist. Using DQUOTE as separator, + // limits me to a string instead of a stringlist. Using DTQUOTE as separator, // because it's forbidden in userids by rfc3501 kdDebug(7116) << getResults() << endl; infoMessage(getResults().join( "\"" )); @@ -1718,9 +1718,9 @@ IMAP4Protocol::specialQuotaCommand( int command, TQDataStream& stream ) parseURL (_url, aBox, aSection, aLType, aSequence, aValidity, aDelimiter, aInfo); switch( command ) { - case 'R': // GEQUOTAROOT + case 'R': // GETQUOTAROOT { - kdDebug(7116) << "QUOTAROOT " << aBox << endl; + kdDebug(7116) << "TQUOTAROOT " << aBox << endl; imapCommand *cmd = doCommand(imapCommand::clientGetQuotaroot( aBox ) ); if (cmd->result () != "OK") { @@ -1734,15 +1734,15 @@ IMAP4Protocol::specialQuotaCommand( int command, TQDataStream& stream ) finished(); break; } - case 'G': // GEQUOTA + case 'G': // GETQUOTA { - kdDebug(7116) << "GEQUOTA command" << endl; + kdDebug(7116) << "GETQUOTA command" << endl; kdWarning(7116) << "UNIMPLEMENTED" << endl; break; } - case 'S': // SEQUOTA + case 'S': // SETQUOTA { - kdDebug(7116) << "SEQUOTA command" << endl; + kdDebug(7116) << "SETQUOTA command" << endl; kdWarning(7116) << "UNIMPLEMENTED" << endl; break; } @@ -1816,7 +1816,7 @@ IMAP4Protocol::slave_status () { bool connected = (getState() != ISTATE_NO) && isConnectionValid(); kdDebug(7116) << "IMAP4::slave_status " << connected << endl; - slavetqStatus ( connected ? myHost : TQString::null, connected ); + slavetqStatus ( connected ? myHost : TQString(), connected ); } void @@ -1863,7 +1863,7 @@ IMAP4Protocol::stat (const KURL & _url) ok = true; else { - imapCommand *cmd = doCommand(imapCommand::clienStatus(aBox, aSection)); + imapCommand *cmd = doCommand(imapCommand::clientqStatus(aBox, aSection)); ok = cmd->result() == "OK"; cmdInfo = cmd->resultInfo(); completeQueue.removeRef(cmd); @@ -1887,13 +1887,13 @@ IMAP4Protocol::stat (const KURL & _url) error(KIO::ERR_DOES_NOT_EXIST, aBox); return; } - if ((aSection == "UIDNEXT" && geStatus().uidNextAvailable()) - || (aSection == "UNSEEN" && geStatus().unseenAvailable())) + if ((aSection == "UIDNEXT" && getqStatus().uidNextAvailable()) + || (aSection == "UNSEEN" && getqStatus().unseenAvailable())) { atom.m_uds = UDS_SIZE; - atom.m_str = TQString::null; - atom.m_long = (aSection == "UIDNEXT") ? geStatus().uidNext() - : geStatus().unseen(); + atom.m_str = TQString(); + atom.m_long = (aSection == "UIDNEXT") ? getqStatus().uidNext() + : getqStatus().unseen(); entry.append(atom); } } else @@ -1910,9 +1910,9 @@ IMAP4Protocol::stat (const KURL & _url) // only do this if the box is not selected // the server might change the validity for new select/examine imapCommand *cmd = - doCommand (imapCommand::clienStatus (aBox, "UIDVALIDITY")); + doCommand (imapCommand::clientqStatus (aBox, "UIDVALIDITY")); completeQueue.removeRef (cmd); - validity = geStatus ().uidValidity (); + validity = getqStatus ().uidValidity (); } validity = 0; // temporary @@ -1954,7 +1954,7 @@ IMAP4Protocol::stat (const KURL & _url) { case ITYPE_DIR: atom.m_uds = UDS_FILE_TYPE; - atom.m_str = TQString::null; + atom.m_str = TQString(); atom.m_long = S_IFDIR; entry.append (atom); break; @@ -1962,7 +1962,7 @@ IMAP4Protocol::stat (const KURL & _url) case ITYPE_BOX: case ITYPE_DIR_AND_BOX: atom.m_uds = UDS_FILE_TYPE; - atom.m_str = TQString::null; + atom.m_str = TQString(); atom.m_long = S_IFDIR; entry.append (atom); break; @@ -1970,7 +1970,7 @@ IMAP4Protocol::stat (const KURL & _url) case ITYPE_MSG: case ITYPE_ATTACH: atom.m_uds = UDS_FILE_TYPE; - atom.m_str = TQString::null; + atom.m_str = TQString(); atom.m_long = S_IFREG; entry.append (atom); break; @@ -2008,7 +2008,7 @@ void IMAP4Protocol::closeConnection() completeQueue.clear(); sentQueue.clear(); lastHandled = 0; - currentBox = TQString::null; + currentBox = TQString(); readBufferLen = 0; } @@ -2188,7 +2188,7 @@ bool IMAP4Protocol::makeLogin () } if ( it != listResponses.end() ) { - namespaceToDelimiter[TQString::null] = (*it).hierarchyDelimiter(); + namespaceToDelimiter[TQString()] = (*it).hierarchyDelimiter(); kdDebug(7116) << "makeLogin - delimiter for empty ns='" << (*it).hierarchyDelimiter() << "'" << endl; if ( !hasCapability("NAMESPACE") ) @@ -2225,7 +2225,7 @@ IMAP4Protocol::parseWriteLine (const TQString & aStr) write(writer.data(), len); } -QString +TQString IMAP4Protocol::getMimeType (enum IMAP_TYPE aType) { switch (aType) @@ -2264,7 +2264,7 @@ IMAP4Protocol::doListEntry (const KURL & _url, int stretch, imapCache * cache, bool withFlags, bool withSubject) { KURL aURL = _url; - aURL.setQuery (TQString::null); + aURL.setQuery (TQString()); const TQString encodedUrl = aURL.url(0, 106); // utf-8 doListEntry(encodedUrl, stretch, cache, withFlags, withSubject); } @@ -2309,7 +2309,7 @@ IMAP4Protocol::doListEntry (const TQString & encodedUrl, int stretch, imapCache entry.append (atom); atom.m_uds = UDS_FILE_TYPE; - atom.m_str = TQString::null; + atom.m_str = TQString(); atom.m_long = S_IFREG; entry.append (atom); @@ -2339,7 +2339,7 @@ IMAP4Protocol::doListEntry (const KURL & _url, const TQString & myBox, const imapList & item, bool appendPath) { KURL aURL = _url; - aURL.setQuery (TQString::null); + aURL.setQuery (TQString()); UDSEntry entry; UDSAtom atom; int hdLen = item.hierarchyDelimiter().length(); @@ -2349,7 +2349,7 @@ IMAP4Protocol::doListEntry (const KURL & _url, const TQString & myBox, TQString mailboxName = item.name (); // some beautification - if (mailboxName.find (myBox) == 0 && mailboxName.length() > myBox.length()) + if (mailboxName.tqfind (myBox) == 0 && mailboxName.length() > myBox.length()) { mailboxName = mailboxName.right (mailboxName.length () - myBox.length ()); @@ -2363,7 +2363,7 @@ IMAP4Protocol::doListEntry (const KURL & _url, const TQString & myBox, atom.m_uds = UDS_NAME; if (!item.hierarchyDelimiter().isEmpty() && - mailboxName.find(item.hierarchyDelimiter()) != -1) + mailboxName.tqfind(item.hierarchyDelimiter()) != -1) atom.m_str = mailboxName.section(item.hierarchyDelimiter(), -1); else atom.m_str = mailboxName; @@ -2392,7 +2392,7 @@ IMAP4Protocol::doListEntry (const KURL & _url, const TQString & myBox, // explicitly set this as a directory for KFileDialog atom.m_uds = UDS_FILE_TYPE; - atom.m_str = TQString::null; + atom.m_str = TQString(); atom.m_long = S_IFDIR; entry.append (atom); } @@ -2406,7 +2406,7 @@ IMAP4Protocol::doListEntry (const KURL & _url, const TQString & myBox, // explicitly set this as a directory for KFileDialog atom.m_uds = UDS_FILE_TYPE; - atom.m_str = TQString::null; + atom.m_str = TQString(); atom.m_long = S_IFDIR; entry.append (atom); } @@ -2554,17 +2554,17 @@ IMAP4Protocol::parseURL (const KURL & _url, TQString & _box, { if (!_uid.isEmpty ()) { - if (_uid.find (':') == -1 && _uid.find (',') == -1 - && _uid.find ('*') == -1) + if (_uid.tqfind (':') == -1 && _uid.tqfind (',') == -1 + && _uid.tqfind ('*') == -1) retVal = ITYPE_MSG; } } if (retVal == ITYPE_MSG) { - if ( (_section.find ("BODY.PEEK[", 0, false) != -1 || - _section.find ("BODY[", 0, false) != -1) && - _section.find(".MIME") == -1 && - _section.find(".HEADER") == -1 ) + if ( (_section.tqfind ("BODY.PEEK[", 0, false) != -1 || + _section.tqfind ("BODY[", 0, false) != -1) && + _section.tqfind(".MIME") == -1 && + _section.tqfind(".HEADER") == -1 ) retVal = ITYPE_ATTACH; } if ( _hierarchyDelimiter.isEmpty() && @@ -2629,14 +2629,14 @@ void IMAP4Protocol::flushOutput(TQString contentEncoding) { // get the coding from the MIME header TQByteArray decoded; - if (contentEncoding.find("quoted-printable", 0, false) == 0) + if (contentEncoding.tqfind("quoted-printable", 0, false) == 0) decoded = KCodecs::quotedPrintableDecode(outputCache); - else if (contentEncoding.find("base64", 0, false) == 0) + else if (contentEncoding.tqfind("base64", 0, false) == 0) KCodecs::base64Decode(outputCache, decoded); else decoded = outputCache; - TQString mimetype = KMimeType::tqfindByContent( decoded )->name(); + TQString mimetype = KMimeType::findByContent( decoded )->name(); kdDebug(7116) << "IMAP4::flushOutput - mimeType " << mimetype << endl; mimeType(mimetype); decodeContent = false; @@ -2697,7 +2697,7 @@ IMAP4Protocol::assureBox (const TQString & aBox, bool readonly) } completeQueue.removeRef (cmd); if (found) { - if (cmdInfo.find("permission", 0, false) != -1) { + if (cmdInfo.tqfind("permission", 0, false) != -1) { // not allowed to enter this folder error(ERR_ACCESS_DENIED, cmdInfo); } else { diff --git a/kioslaves/imap4/imap4.h b/kioslaves/imap4/imap4.h index a44b4eb78..d03f8c0c8 100644 --- a/kioslaves/imap4/imap4.h +++ b/kioslaves/imap4/imap4.h @@ -37,8 +37,8 @@ enum IMAP_TYPE { ITYPE_UNKNOWN, /*< unknown type */ ITYPE_DIR, /*< Object is a directory. i.e. does not contain message, just mailboxes */ - ITYPE_BOX, /*< Object is a mailbox. i.e. tqcontains mails */ - ITYPE_DIR_AND_BOX, /*< Object tqcontains both mails and mailboxes */ + ITYPE_BOX, /*< Object is a mailbox. i.e. contains mails */ + ITYPE_DIR_AND_BOX, /*< Object contains both mails and mailboxes */ ITYPE_MSG, /*< Object is a mail */ ITYPE_ATTACH /*< Object is an attachment */ }; @@ -126,7 +126,7 @@ public: virtual int outputLine (const TQCString & _str, int len = -1); /** @brief send out cached data to the application */ - virtual void flushOutput(TQString contentEncoding = TQString::null); + virtual void flushOutput(TQString contentEncoding = TQString()); protected: diff --git a/kioslaves/imap4/imapcommand.cc b/kioslaves/imap4/imapcommand.cc index 979562003..65a9227d0 100644 --- a/kioslaves/imap4/imapcommand.cc +++ b/kioslaves/imap4/imapcommand.cc @@ -58,7 +58,7 @@ imapCommand::imapCommand () { mComplete = false; - mId = TQString::null; + mId = TQString(); } imapCommand::imapCommand (const TQString & command, const TQString & parameter) @@ -69,7 +69,7 @@ imapCommand::imapCommand (const TQString & command, const TQString & parameter) mComplete = false; aCommand = command; aParameter = parameter; - mId = TQString::null; + mId = TQString(); } bool @@ -145,7 +145,7 @@ imapCommand::setParameter (const TQString & parameter) aParameter = parameter; } -const QString +const TQString imapCommand::getStr () { if (parameter().isEmpty()) @@ -236,7 +236,7 @@ imapCommand::clientAppend (const TQString & box, const TQString & flags, } imapCommand * -imapCommand::clienStatus (const TQString & path, const TQString & parameters) +imapCommand::clientqStatus (const TQString & path, const TQString & parameters) { return new imapCommand ("STATUS", TQString ("\"") + rfcDecoder::toIMAP (path) + @@ -397,7 +397,7 @@ imapCommand * imapCommand::clientGetQuotaroot( const TQString& box ) { TQString parameter = TQString("\"") + rfcDecoder::toIMAP (box) + '"'; - return new imapCommand ("GEQUOTAROOT", parameter); + return new imapCommand ("GETQUOTAROOT", parameter); } imapCommand * diff --git a/kioslaves/imap4/imapcommand.h b/kioslaves/imap4/imapcommand.h index 4c9552023..9ddb3f252 100644 --- a/kioslaves/imap4/imapcommand.h +++ b/kioslaves/imap4/imapcommand.h @@ -212,7 +212,7 @@ public: * @param parameters * @return a STATUS imapCommand */ - static imapCommand *clienStatus (const TQString & path, + static imapCommand *clientqStatus (const TQString & path, const TQString & parameters); /** * @brief Create a COPY command @@ -365,9 +365,9 @@ public: static imapCommand *clientNamespace (); /** - * @brief Create a GEQUOTAROOT command + * @brief Create a GETQUOTAROOT command * @param box mailbox name - * @return a GEQUOTAROOT imapCommand + * @return a GETQUOTAROOT imapCommand */ static imapCommand *clientGetQuotaroot ( const TQString& box ); diff --git a/kioslaves/imap4/imapinfo.cc b/kioslaves/imap4/imapinfo.cc index c65eca0c7..be955c233 100644 --- a/kioslaves/imap4/imapinfo.cc +++ b/kioslaves/imap4/imapinfo.cc @@ -147,8 +147,8 @@ permanentFlagsAvailable_ (false), readWriteAvailable_ (false) else if (tokens[2] == "[PERMANENTFLAGS") { - int flagsStart = line.find('('); - int flagsEnd = line.find(')'); + int flagsStart = line.tqfind('('); + int flagsEnd = line.tqfind(')'); kdDebug(7116) << "Checking permFlags from " << flagsStart << " to " << flagsEnd << endl; if ((-1 != flagsStart) && (-1 != flagsEnd) && flagsStart < flagsEnd) @@ -170,8 +170,8 @@ permanentFlagsAvailable_ (false), readWriteAvailable_ (false) } else if (tokens[1] == "FLAGS") { - int flagsStart = line.find ('('); - int flagsEnd = line.find (')'); + int flagsStart = line.tqfind ('('); + int flagsEnd = line.tqfind (')'); if ((-1 != flagsStart) && (-1 != flagsEnd) && flagsStart < flagsEnd) setFlags (_flags (line.mid (flagsStart, flagsEnd).latin1() )); diff --git a/kioslaves/imap4/imaplist.cc b/kioslaves/imap4/imaplist.cc index b15c821d2..6c9dad64f 100644 --- a/kioslaves/imap4/imaplist.cc +++ b/kioslaves/imap4/imaplist.cc @@ -103,7 +103,7 @@ hasNoChildren_ (false) hierarchyDelimiter_ = parser_->parseOneWordC(s); if (hierarchyDelimiter_ == "NIL") - hierarchyDelimiter_ = TQString::null; + hierarchyDelimiter_ = TQString(); name_ = rfcDecoder::fromIMAP (parser_->parseLiteral (s)); // decode modified UTF7 } @@ -116,17 +116,17 @@ void imapList::parseAttributes( parseString & str ) orig = parser_->parseOneWordC(str); attributes_ << orig; attribute = orig.lower(); - if (-1 != attribute.find ("\\noinferiors")) + if (-1 != attribute.tqfind ("\\noinferiors")) noInferiors_ = true; - else if (-1 != attribute.find ("\\noselect")) + else if (-1 != attribute.tqfind ("\\noselect")) noSelect_ = true; - else if (-1 != attribute.find ("\\marked")) + else if (-1 != attribute.tqfind ("\\marked")) marked_ = true; - else if (-1 != attribute.find ("\\unmarked")) + else if (-1 != attribute.tqfind ("\\unmarked")) unmarked_ = true; - else if (-1 != attribute.find ("\\haschildren")) + else if (-1 != attribute.tqfind ("\\hastqchildren")) hasChildren_ = true; - else if (-1 != attribute.find ("\\hasnochildren")) + else if (-1 != attribute.tqfind ("\\hasnotqchildren")) hasNoChildren_ = true; else kdDebug(7116) << "imapList::imapList: bogus attribute " << attribute << endl; diff --git a/kioslaves/imap4/imapparser.cc b/kioslaves/imap4/imapparser.cc index 0cd8938eb..573665260 100644 --- a/kioslaves/imap4/imapparser.cc +++ b/kioslaves/imap4/imapparser.cc @@ -120,16 +120,16 @@ imapParser::sendCommand (imapCommand * aCmd) else if (command == "CLOSE") { // we no longer have a box open - currentBox = TQString::null; + currentBox = TQString(); } - else if (command.find ("SEARCH") != -1 + else if (command.tqfind ("SEARCH") != -1 || command == "GETACL" || command == "LISTRIGHTS" || command == "MYRIGHTS" || command == "GETANNOTATION" || command == "NAMESPACE" - || command == "GEQUOTAROOT" - || command == "GEQUOTA" + || command == "GETQUOTAROOT" + || command == "GETQUOTA" || command == "X-GET-OTHER-USERS" || command == "X-GET-DELEGATES" || command == "X-GET-OUT-OF-OFFICE") @@ -216,7 +216,7 @@ static bool sasl_interact( KIO::SlaveBase *slave, KIO::AuthInfo &ai, void *in ) bool imapParser::clientAuthenticate ( KIO::SlaveBase *slave, KIO::AuthInfo &ai, - const TQString & aFQDN, const TQString & aAuth, bool isSSL, TQString & resultInfo) + const TQString & aFTQDN, const TQString & aAuth, bool isSSL, TQString & resultInfo) { bool retVal = false; #ifdef HAVE_LIBSASL2 @@ -228,7 +228,7 @@ imapParser::clientAuthenticate ( KIO::SlaveBase *slave, KIO::AuthInfo &ai, const char *mechusing = 0; TQByteArray tmp, challenge; - kdDebug(7116) << "aAuth: " << aAuth << " FQDN: " << aFQDN << " isSSL: " << isSSL << endl; + kdDebug(7116) << "aAuth: " << aAuth << " FTQDN: " << aFTQDN << " isSSL: " << isSSL << endl; // see if server supports this authenticator if (!hasCapability ("AUTH=" + aAuth)) @@ -237,7 +237,7 @@ imapParser::clientAuthenticate ( KIO::SlaveBase *slave, KIO::AuthInfo &ai, // result = sasl_client_new( isSSL ? "imaps" : "imap", result = sasl_client_new( "imap", /* FIXME: with cyrus-imapd, even imaps' digest-uri must be 'imap'. I don't know if it's good or bad. */ - aFQDN.latin1(), + aFTQDN.latin1(), 0, 0, callbacks, 0, &conn ); if ( result != SASL_OK ) { @@ -443,7 +443,7 @@ imapParser::parseUntagged (parseString & result) } else if (tqstrncmp(what, "STATUS", what.size()) == 0) { - parseStatus (result); + parsetqStatus (result); } break; @@ -457,12 +457,12 @@ imapParser::parseUntagged (parseString & result) parseAnnotation (result); } break; - case 'Q': // QUOTA or QUOTAROOT - if ( what.size() > 5 && tqstrncmp(what, "QUOTAROOT", what.size()) == 0) + case 'Q': // TQUOTA or TQUOTAROOT + if ( what.size() > 5 && tqstrncmp(what, "TQUOTAROOT", what.size()) == 0) { parseQuotaRoot( result ); } - else if (tqstrncmp(what, "QUOTA", what.size()) == 0) + else if (tqstrncmp(what, "TQUOTA", what.size()) == 0) { parseQuota( result ); } @@ -498,7 +498,7 @@ imapParser::parseUntagged (parseString & result) case 'F': if (tqstrncmp(what, "FETCH", what.size()) == 0) { - seenUid = TQString::null; + seenUid = TQString(); parseFetch (number, result); } break; @@ -506,7 +506,7 @@ imapParser::parseUntagged (parseString & result) case 'S': if (tqstrncmp(what, "STORE", what.size()) == 0) // deprecated store { - seenUid = TQString::null; + seenUid = TQString(); parseFetch (number, result); } break; @@ -544,7 +544,7 @@ imapParser::parseResult (TQByteArray & result, parseString & rest, case 'A': // ALERT if (option == "ALERT") { - rest.pos = rest.data.find(']', rest.pos) + 1; + rest.pos = rest.data.tqfind(']', rest.pos) + 1; // The alert text is after [ALERT]. // Is this correct or do we need to care about litterals? selectInfo.setAlert( rest.cstr() ); @@ -563,7 +563,7 @@ imapParser::parseResult (TQByteArray & result, parseString & rest, } else if (option == "PERMANENTFLAGS") { - uint end = rest.data.find(']', rest.pos); + uint end = rest.data.tqfind(']', rest.pos); TQCString flags(rest.data.data() + rest.pos, end - rest.pos); selectInfo.setPermanentFlags (flags); rest.pos = end; @@ -645,7 +645,7 @@ imapParser::parseResult (TQByteArray & result, parseString & rest, { if (currentState == ISTATE_SELECT) currentState = ISTATE_LOGIN; - currentBox = TQString::null; + currentBox = TQString(); } kdDebug(7116) << "imapParser::parseResult - current box is now " << currentBox << endl; } @@ -660,7 +660,7 @@ imapParser::parseResult (TQByteArray & result, parseString & rest, { if (currentState == ISTATE_SELECT) currentState = ISTATE_LOGIN; - currentBox = TQString::null; + currentBox = TQString(); } kdDebug(7116) << "imapParser::parseResult - current box is now " << currentBox << endl; } @@ -752,7 +752,7 @@ void imapParser::parseAnnotation (parseString & result) void imapParser::parseQuota (parseString & result) { - // quota_response ::= "QUOTA" SP astring SP quota_list + // quota_response ::= "TQUOTA" SP astring SP quota_list // quota_list ::= "(" #quota_resource ")" // quota_resource ::= atom SP number SP number TQCString root = parseOneWordC( result ); @@ -777,7 +777,7 @@ void imapParser::parseQuota (parseString & result) void imapParser::parseQuotaRoot (parseString & result) { // quotaroot_response - // ::= "QUOTAROOT" SP astring *(SP astring) + // ::= "TQUOTAROOT" SP astring *(SP astring) parseOneWordC (result); // skip mailbox name skipWS (result); if ( result.isEmpty() ) @@ -845,9 +845,9 @@ void imapParser::parseSearch (parseString & result) } } -void imapParser::parseStatus (parseString & inWords) +void imapParser::parsetqStatus (parseString & inWords) { - lasStatus = imapInfo (); + lastqStatus = imapInfo (); parseLiteralC(inWords); // swallow the box if (inWords.isEmpty() || inWords[0] != '(') @@ -864,15 +864,15 @@ void imapParser::parseStatus (parseString & inWords) if (parseOneNumber (inWords, value)) { if (label == "MESSAGES") - lasStatus.setCount (value); + lastqStatus.setCount (value); else if (label == "RECENT") - lasStatus.setRecent (value); + lastqStatus.setRecent (value); else if (label == "UIDVALIDITY") - lasStatus.setUidValidity (value); + lastqStatus.setUidValidity (value); else if (label == "UNSEEN") - lasStatus.setUnseen (value); + lastqStatus.setUnseen (value); else if (label == "UIDNEXT") - lasStatus.setUidNext (value); + lastqStatus.setUidNext (value); } } @@ -1114,7 +1114,7 @@ mimeHeader * imapParser::parseSimplePart (parseString & inWords, localPart->setType (typeStr + "/" + subtype); - //body parameter parenthesized list + //body parameter tqparenthesized list parameters = parseParameters (inWords); { TQAsciiDictIterator < TQString > it (parameters); @@ -1379,7 +1379,7 @@ void imapParser::parseBody (parseString & inWords) kdDebug(7116) << "imapParser::parseBody - reading " << envelope << " " << seenUid.ascii () << endl; // fill it up with data TQString theHeader = parseLiteralC(inWords, true); - mimeIOQString myIO; + mimeIOTQString myIO; myIO.setString (theHeader); envelope->parseHeader (myIO); @@ -1406,7 +1406,7 @@ void imapParser::parseBody (parseString & inWords) else { TQCString references = parseLiteralC(inWords, true); - int start = references.find ('<'); + int start = references.tqfind ('<'); int end = references.findRev ('>'); if (start < end) references = references.mid (start, end - start + 1); @@ -1420,11 +1420,11 @@ void imapParser::parseBody (parseString & inWords) } else { - if (specifier.find(".MIME") != -1) + if (specifier.tqfind(".MIME") != -1) { mailHeader *envelope = new mailHeader; TQString theHeader = parseLiteralC(inWords, false); - mimeIOQString myIO; + mimeIOTQString myIO; myIO.setString (theHeader); envelope->parseHeader (myIO); if (lastHandled) @@ -1573,7 +1573,7 @@ void imapParser::parseFetch (ulong /* value */, parseString & inWords) if (!lastHandled) lastHandled = new imapCache(); lastHandled->setSize (size); } - else if (word.find ("RFC822") == 0) + else if (word.tqfind ("RFC822") == 0) { // might be RFC822 RFC822.TEXT RFC822.HEADER parseLiteralC(inWords, true); @@ -1628,7 +1628,7 @@ void imapParser::parseSentence (parseString & inWords) bool first = true; int stack = 0; - //find the first nesting parentheses + //find the first nesting tqparentheses while (!inWords.isEmpty () && (stack != 0 || first)) { @@ -1675,8 +1675,8 @@ void imapParser::parseNamespace (parseString & result) return; TQString delimEmpty; - if ( namespaceToDelimiter.tqcontains( TQString::null ) ) - delimEmpty = namespaceToDelimiter[TQString::null]; + if ( namespaceToDelimiter.tqcontains( TQString() ) ) + delimEmpty = namespaceToDelimiter[TQString()]; namespaceToDelimiter.clear(); imapNamespaces.clear(); @@ -1733,7 +1733,7 @@ void imapParser::parseNamespace (parseString & result) } if ( !delimEmpty.isEmpty() ) { // remember default delimiter - namespaceToDelimiter[TQString::null] = delimEmpty; + namespaceToDelimiter[TQString()] = delimEmpty; if ( !personalAvailable ) { // at least one personal ns would be nice @@ -1855,7 +1855,7 @@ imapParser::parseURL (const KURL & _url, TQString & _box, TQString & _section, _box = _url.path (); kdDebug(7116) << "imapParser::parseURL " << _box << endl; - int paramStart = _box.find("/;"); + int paramStart = _box.tqfind("/;"); if ( paramStart > -1 ) { TQString paramString = _box.right( _box.length() - paramStart-2 ); @@ -1868,24 +1868,24 @@ imapParser::parseURL (const KURL & _url, TQString & _box, TQString & _section, { TQString temp = (*it); - int pt = temp.find ('/'); + int pt = temp.tqfind ('/'); if (pt > 0) { - if (temp.findRev ('"', pt) == -1 || temp.find('"', pt) == -1) + if (temp.findRev ('"', pt) == -1 || temp.tqfind('"', pt) == -1) { // if we have non-quoted '/' separator we'll just nuke it temp.truncate(pt); } } - if (temp.find ("section=", 0, false) == 0) + if (temp.tqfind ("section=", 0, false) == 0) _section = temp.right (temp.length () - 8); - else if (temp.find ("type=", 0, false) == 0) + else if (temp.tqfind ("type=", 0, false) == 0) _type = temp.right (temp.length () - 5); - else if (temp.find ("uid=", 0, false) == 0) + else if (temp.tqfind ("uid=", 0, false) == 0) _uid = temp.right (temp.length () - 4); - else if (temp.find ("uidvalidity=", 0, false) == 0) + else if (temp.tqfind ("uidvalidity=", 0, false) == 0) _validity = temp.right (temp.length () - 12); - else if (temp.find ("info=", 0, false) == 0) + else if (temp.tqfind ("info=", 0, false) == 0) _info = temp.right (temp.length () - 5); } // kdDebug(7116) << "URL: section= " << _section << ", type= " << _type << ", uid= " << _uid << endl; @@ -1911,7 +1911,7 @@ TQCString imapParser::parseLiteralC(parseString & inWords, bool relay, bool stop if (!inWords.isEmpty() && inWords[0] == '{') { TQCString retVal; - ulong runLen = inWords.find ('}', 1); + ulong runLen = inWords.tqfind ('}', 1); if (runLen > 0) { bool proper; @@ -1927,7 +1927,7 @@ TQCString imapParser::parseLiteralC(parseString & inWords, bool relay, bool stop parseRelay (runLen); TQByteArray rv; parseRead (rv, runLen, relay ? runLen : 0); - rv.resize(QMAX(runLen, rv.size())); // what's the point? + rv.resize(TQMAX(runLen, rv.size())); // what's the point? retVal = b2c(rv); inWords.clear(); parseReadLine (inWords.data); // must get more @@ -2076,7 +2076,7 @@ TQString imapParser::namespaceForBox( const TQString & box ) TQString cleanPrefix; for ( TQValueList::Iterator it = list.begin(); it != list.end(); ++it ) { - if ( !(*it).isEmpty() && box.find( *it ) != -1 ) + if ( !(*it).isEmpty() && box.tqfind( *it ) != -1 ) return (*it); } } diff --git a/kioslaves/imap4/imapparser.h b/kioslaves/imap4/imapparser.h index d40524d1c..0552baf83 100644 --- a/kioslaves/imap4/imapparser.h +++ b/kioslaves/imap4/imapparser.h @@ -60,9 +60,9 @@ public: if (pos >= data.size()) return TQCString(); return TQCString(data.data() + pos, data.size() - pos + 1); } - int find(char c, int index = 0) + int tqfind(char c, int index = 0) { - int res = data.find(c, index + pos); + int res = data.tqfind(c, index + pos); return (res == -1) ? res : (res - pos); } // Warning: does not check for going past end of "data" @@ -244,7 +244,7 @@ public: * @param resultInfo The resultinfo from the command * @return success or failure */ - bool clientAuthenticate (KIO::SlaveBase *slave, KIO::AuthInfo &ai, const TQString & aFQDN, + bool clientAuthenticate (KIO::SlaveBase *slave, KIO::AuthInfo &ai, const TQString & aFTQDN, const TQString & aAuth, bool isSSL, TQString & resultInfo); /** @@ -263,7 +263,7 @@ public: void parseRecent (ulong value, parseString & result); /** @brief parse a RESULT line */ void parseResult (TQByteArray & result, parseString & rest, - const TQString & command = TQString::null); + const TQString & command = TQString()); /** @brief parse a CAPABILITY line */ void parseCapability (parseString & result); /** @brief parse a FLAGS line */ @@ -279,7 +279,7 @@ public: /** @brief parse a SEARCH line */ void parseSearch (parseString & result); /** @brief parse a STATUS line */ - void parseStatus (parseString & result); + void parsetqStatus (parseString & result); /** @brief parse a EXISTS line */ void parseExists (ulong value, parseString & result); /** @brief parse a EXPUNGE line */ @@ -290,9 +290,9 @@ public: void parseAnnotation (parseString & result); /** @brief parse a NAMESPACE line */ void parseNamespace (parseString & result); - /** @brief parse a QUOTAROOT line */ + /** @brief parse a TQUOTAROOT line */ void parseQuotaRoot (parseString & result); - /** @brief parse a QUOTA line */ + /** @brief parse a TQUOTA line */ void parseQuota (parseString & result); /** @brief parse a custom command line */ void parseCustom (parseString & result); @@ -356,7 +356,7 @@ public: // generic parser routines - /** parse a parenthesized list */ + /** parse a tqparenthesized list */ void parseSentence (parseString & inWords); /** parse a literal or word, may require more data */ @@ -404,9 +404,9 @@ public: }; /** @brief return the last status code */ - const imapInfo & geStatus () + const imapInfo & getqStatus () { - return lasStatus; + return lastqStatus; }; /** return the select info */ const imapInfo & getSelected () @@ -450,7 +450,7 @@ protected: imapInfo selectInfo; /** @brief the results from the last status command */ - imapInfo lasStatus; + imapInfo lastqStatus; /** @brief the results from the capabilities, split at ' ' */ TQStringList imapCapabilities; diff --git a/kioslaves/imap4/mailaddress.cc b/kioslaves/imap4/mailaddress.cc index 227defa97..0775d0f36 100644 --- a/kioslaves/imap4/mailaddress.cc +++ b/kioslaves/imap4/mailaddress.cc @@ -105,7 +105,7 @@ mailAddress::parseAddress (char *aCStr) len = advance; user = user.mid (1, len - 2); // strip <> len -= 2; - pt = user.find('@'); + pt = user.tqfind('@'); host = user.right (len - pt - 1); // split it into host user.truncate(pt); // and user break; @@ -161,7 +161,7 @@ mailAddress::parseAddress (char *aCStr) } else if (user.isEmpty ()) { - pt = rawFullName.find ('@'); + pt = rawFullName.tqfind ('@'); if (pt >= 0) { user = rawFullName; @@ -196,7 +196,7 @@ mailAddress::parseAddress (char *aCStr) return retVal; } -const QCString +const TQCString mailAddress::getStr () { TQCString retVal(128); // Should be generally big enough @@ -235,7 +235,7 @@ mailAddress::setFullName (const TQString & _str) { rawFullName = rfcDecoder::encodeRFC2047String (_str).latin1 (); } -const QString +const TQString mailAddress::getFullName () const { return rfcDecoder::decodeRFC2047String (rawFullName); @@ -252,7 +252,7 @@ mailAddress::setComment (const TQString & _str) { rawComment = rfcDecoder::encodeRFC2047String (_str).latin1 (); } -const QString +const TQString mailAddress::getComment () const { return rfcDecoder::decodeRFC2047String (rawComment); @@ -264,7 +264,7 @@ mailAddress::getCommentRaw () const return rawComment; } -QString +TQString mailAddress::emailAddrAsAnchor (const mailAddress & adr, bool shortAdr) { TQString retVal; @@ -298,7 +298,7 @@ mailAddress::emailAddrAsAnchor (const mailAddress & adr, bool shortAdr) return retVal; } -QString +TQString mailAddress::emailAddrAsAnchor (const TQPtrList < mailAddress > &list, bool value) { TQString retVal; diff --git a/kioslaves/imap4/mailheader.cc b/kioslaves/imap4/mailheader.cc index dea9ce5fd..285bd325a 100644 --- a/kioslaves/imap4/mailheader.cc +++ b/kioslaves/imap4/mailheader.cc @@ -186,7 +186,7 @@ mailHeader::parseAddressList (const char *inCStr, return advance; } -QCString +TQCString mailHeader::getAddressStr (TQPtrList < mailAddress > *aList) { TQCString retVal; diff --git a/kioslaves/imap4/mimehdrline.cc b/kioslaves/imap4/mimehdrline.cc index 0706d04c4..56c9b2d74 100644 --- a/kioslaves/imap4/mimehdrline.cc +++ b/kioslaves/imap4/mimehdrline.cc @@ -480,7 +480,7 @@ mimeHdrLine::getValue () // FIXME: very inefficient still -QCString +TQCString mimeHdrLine::truncateLine(TQCString aLine, unsigned int truncate) { int cutHere; @@ -489,7 +489,7 @@ mimeHdrLine::truncateLine(TQCString aLine, unsigned int truncate) // see if we have a line of the form "key: value" (like "Subject: bla") // then we do not want to truncate between key and value - int validStart = aLine.find(": "); + int validStart = aLine.tqfind(": "); if (validStart > -1) { validStart += 2; } @@ -498,9 +498,9 @@ mimeHdrLine::truncateLine(TQCString aLine, unsigned int truncate) if (cutHere < 1 || cutHere < validStart) { cutHere = aLine.findRev('\t', truncate); if (cutHere < 1) { - cutHere = aLine.find(' ', 1); + cutHere = aLine.tqfind(' ', 1); if (cutHere < 1) { - cutHere = aLine.find('\t', 1); + cutHere = aLine.tqfind('\t', 1); if (cutHere < 1) { // simply truncate return aLine.left(truncate); diff --git a/kioslaves/imap4/mimehdrline.h b/kioslaves/imap4/mimehdrline.h index 210f5a7c4..e31c18649 100644 --- a/kioslaves/imap4/mimehdrline.h +++ b/kioslaves/imap4/mimehdrline.h @@ -52,10 +52,10 @@ and report characters slurped */ static int parseAlphaNum (const char *); protected: // Protected attributes - /** tqcontains the Value + /** contains the Value */ TQCString mimeValue; - /** tqcontains the Label of the line + /** contains the Label of the line */ TQCString mimeLabel; protected: // Protected methods diff --git a/kioslaves/imap4/mimeheader.cc b/kioslaves/imap4/mimeheader.cc index 1d0b7ab9e..c14fbb705 100644 --- a/kioslaves/imap4/mimeheader.cc +++ b/kioslaves/imap4/mimeheader.cc @@ -168,7 +168,7 @@ mimeHeader::addParameter (const TQCString& aParameter, TQDict < TQString > *aLis TQString *aValue; TQCString aLabel; - int pos = aParameter.find ('='); + int pos = aParameter.tqfind ('='); // cout << aParameter.left(pos).data(); aValue = new TQString (); aValue->setLatin1 (aParameter.right (aParameter.length () - pos - 1)); @@ -180,13 +180,13 @@ mimeHeader::addParameter (const TQCString& aParameter, TQDict < TQString > *aLis // cout << "=" << aValue->data() << endl; } -QString +TQString mimeHeader::getDispositionParm (const TQCString& aStr) { return getParameter (aStr, &dispositionList); } -QString +TQString mimeHeader::getTypeParm (const TQCString& aStr) { return getParameter (aStr, &typeList); @@ -261,18 +261,18 @@ mimeHeader::outputHeader (mimeIO & useIO) useIO.outputMimeLine (TQCString ("")); } -QString +TQString mimeHeader::getParameter (const TQCString& aStr, TQDict < TQString > *aDict) { TQString retVal, *found; if (aDict) { //see if it is a normal parameter - found = aDict->find (aStr); + found = aDict->tqfind (aStr); if (!found) { //might be a continuated or encoded parameter - found = aDict->find (aStr + "*"); + found = aDict->tqfind (aStr + "*"); if (!found) { //continuated parameter @@ -284,10 +284,10 @@ mimeHeader::getParameter (const TQCString& aStr, TQDict < TQString > *aDict) TQCString search; search.setNum (part); search = aStr + "*" + search; - found = aDict->find (search); + found = aDict->tqfind (search); if (!found) { - found = aDict->find (search + "*"); + found = aDict->tqfind (search + "*"); if (found) encoded += rfcDecoder::encodeRFC2231String (*found); } @@ -298,7 +298,7 @@ mimeHeader::getParameter (const TQCString& aStr, TQDict < TQString > *aDict) part++; } while (found); - if (encoded.find ('\'') >= 0) + if (encoded.tqfind ('\'') >= 0) { retVal = rfcDecoder::decodeRFC2231String (encoded.local8Bit ()); } @@ -335,7 +335,7 @@ mimeHeader::setParameter (const TQCString& aLabel, const TQString& aValue, { //see if it needs to get encoded - if (encoded && aLabel.find ('*') == -1) + if (encoded && aLabel.tqfind ('*') == -1) { val = rfcDecoder::encodeRFC2231String (aValue); } @@ -402,7 +402,7 @@ mimeHeader::setParameter (const TQCString& aLabel, const TQString& aValue, } } -QCString +TQCString mimeHeader::outputParameter (TQDict < TQString > *aDict) { TQCString retVal; @@ -412,7 +412,7 @@ mimeHeader::outputParameter (TQDict < TQString > *aDict) while (it.current ()) { retVal += (";\n\t" + it.currentKey () + "=").latin1 (); - if (it.current ()->find (' ') > 0 || it.current ()->find (';') > 0) + if (it.current ()->tqfind (' ') > 0 || it.current ()->tqfind (';') > 0) { retVal += '"' + it.current ()->utf8 () + '"'; } @@ -527,7 +527,7 @@ mimeHeader::parseBody (mimeIO & useIO, TQCString & messageBody, retVal = 1; //continue with next part break; } - else if (mbox && inputStr.find ("From ") == 0) + else if (mbox && inputStr.tqfind ("From ") == 0) { retVal = 0; // end of mbox break; @@ -556,7 +556,7 @@ mimeHeader::parseHeader (mimeIO & useIO) while (useIO.inputLine (inputStr)) { int appended; - if (inputStr.find ("From ") != 0 || !first) + if (inputStr.tqfind ("From ") != 0 || !first) { first = false; appended = my_line.appendStr (inputStr); @@ -584,7 +584,7 @@ mimeHeader * mimeHeader::bodyPart (const TQString & _str) { // see if it is nested a little deeper - int pt = _str.find('.'); + int pt = _str.tqfind('.'); if (pt != -1) { TQString tempStr = _str; @@ -643,7 +643,7 @@ void mimeHeader::serialize(TQDataStream& stream) #ifdef KMAIL_COMPATIBLE // compatibility subroutines -QString +TQString mimeHeader::bodyDecoded () { kdDebug(7116) << "mimeHeader::bodyDecoded" << endl; @@ -653,14 +653,14 @@ mimeHeader::bodyDecoded () return TQString::tqfromLatin1 (temp.data (), temp.count ()); } -QByteArray +TQByteArray mimeHeader::bodyDecodedBinary () { TQByteArray retVal; - if (contentEncoding.find ("quoted-printable", 0, false) == 0) + if (contentEncoding.tqfind ("quoted-printable", 0, false) == 0) retVal = KCodecs::quotedPrintableDecode(postMultipartBody); - else if (contentEncoding.find ("base64", 0, false) == 0) + else if (contentEncoding.tqfind ("base64", 0, false) == 0) KCodecs::base64Decode(postMultipartBody, retVal); else retVal = postMultipartBody; @@ -680,9 +680,9 @@ mimeHeader::setBodyEncoded (const TQByteArray & _arr) TQByteArray setVal; kdDebug(7116) << "mimeHeader::setBodyEncoded - in size " << _arr.size () << endl; - if (contentEncoding.find ("quoted-printable", 0, false) == 0) + if (contentEncoding.tqfind ("quoted-printable", 0, false) == 0) setVal = KCodecs::quotedPrintableEncode(_arr); - else if (contentEncoding.find ("base64", 0, false) == 0) + else if (contentEncoding.tqfind ("base64", 0, false) == 0) KCodecs::base64Encode(_arr, setVal); else setVal.duplicate (_arr); @@ -692,14 +692,14 @@ mimeHeader::setBodyEncoded (const TQByteArray & _arr) kdDebug(7116) << "mimeHeader::setBodyEncoded - out size " << postMultipartBody.size () << endl; } -QString +TQString mimeHeader::iconName () { TQString fileName; // FIXME: bug? Why throw away this data? fileName = - KMimeType::mimeType (contentType.lower ())->icon (TQString::null, false); + KMimeType::mimeType (contentType.lower ())->icon (TQString(), false); fileName = KGlobal::instance ()->iconLoader ()->iconPath (fileName, KIcon::Desktop); // if (fileName.isEmpty()) @@ -714,16 +714,16 @@ mimeHeader::setNestedMessage (mailHeader * inPart, bool destroy) nestedMessage = inPart; } -QString +TQString mimeHeader::headerAsString () { - mimeIOQString myIO; + mimeIOTQString myIO; outputHeader (myIO); return myIO.getString (); } -QString +TQString mimeHeader::magicSetType (bool aAutoDecode) { TQString mimetype; diff --git a/kioslaves/imap4/mimeheader.h b/kioslaves/imap4/mimeheader.h index 0eb46630b..14d86e9d0 100644 --- a/kioslaves/imap4/mimeheader.h +++ b/kioslaves/imap4/mimeheader.h @@ -56,7 +56,7 @@ public: void setTypeParm (const TQCString&, const TQString&); TQDictIterator < TQString > getTypeIterator (); - // recursively serialize all important contents to the QDataStream + // recursively serialize all important contents to the TQDataStream void serialize(TQDataStream& stream); const TQCString& getType () @@ -227,7 +227,7 @@ public: } TQString typeStr () { - return TQString (contentType.left (contentType.find ('/'))); + return TQString (contentType.left (contentType.tqfind ('/'))); } void setTypeStr (const TQString & _str) { @@ -236,7 +236,7 @@ public: TQString subtypeStr () { return TQString (contentType. - right (contentType.length () - contentType.find ('/') - + right (contentType.length () - contentType.tqfind ('/') - 1)); } void setSubtypeStr (const TQString & _str) diff --git a/kioslaves/imap4/mimeio.cc b/kioslaves/imap4/mimeio.cc index 5adf28f98..971cd0a9c 100644 --- a/kioslaves/imap4/mimeio.cc +++ b/kioslaves/imap4/mimeio.cc @@ -83,7 +83,7 @@ mimeIO::outputMimeLine (const TQCString & inLine) { int start, end, offset; start = 0; - end = aLine.find ('\n', start); + end = aLine.tqfind ('\n', start); while (end >= 0) { offset = 1; @@ -94,7 +94,7 @@ mimeIO::outputMimeLine (const TQCString & inLine) } outputLine (aLine.mid (start, end - start) + theCRLF, end - start + crlfLen); start = end + offset; - end = aLine.find ('\n', start); + end = aLine.tqfind ('\n', start); } outputLine (aLine.mid (start, len - start) + theCRLF, len - start + crlfLen); } @@ -127,26 +127,26 @@ mimeIO::setCRLF (const char *aCRLF) crlfLen = strlen(aCRLF); } -mimeIOQFile::mimeIOQFile (const TQString & aName): +mimeIOTQFile::mimeIOTQFile (const TQString & aName): mimeIO (), myFile (aName) { myFile.open (IO_ReadOnly); } -mimeIOQFile::~mimeIOQFile () +mimeIOTQFile::~mimeIOTQFile () { myFile.close (); } int -mimeIOQFile::outputLine (const TQCString &, int) +mimeIOTQFile::outputLine (const TQCString &, int) { return 0; } int -mimeIOQFile::inputLine (TQCString & data) +mimeIOTQFile::inputLine (TQCString & data) { data.resize( 1024 ); myFile.readLine (data.data(), 1024); @@ -154,16 +154,16 @@ mimeIOQFile::inputLine (TQCString & data) return data.length (); } -mimeIOQString::mimeIOQString () +mimeIOTQString::mimeIOTQString () { } -mimeIOQString::~mimeIOQString () +mimeIOTQString::~mimeIOTQString () { } int -mimeIOQString::outputLine (const TQCString & _str, int len) +mimeIOTQString::outputLine (const TQCString & _str, int len) { if (len == -1) { len = _str.length(); @@ -173,12 +173,12 @@ mimeIOQString::outputLine (const TQCString & _str, int len) } int -mimeIOQString::inputLine (TQCString & _str) +mimeIOTQString::inputLine (TQCString & _str) { if (theString.isEmpty ()) return 0; - int i = theString.find ('\n'); + int i = theString.tqfind ('\n'); if (i == -1) return 0; diff --git a/kioslaves/imap4/mimeio.h b/kioslaves/imap4/mimeio.h index e14861a8b..37a96998f 100644 --- a/kioslaves/imap4/mimeio.h +++ b/kioslaves/imap4/mimeio.h @@ -44,11 +44,11 @@ protected: int crlfLen; }; -class mimeIOQFile:public mimeIO +class mimeIOTQFile:public mimeIO { public: - mimeIOQFile (const TQString &); - virtual ~ mimeIOQFile (); + mimeIOTQFile (const TQString &); + virtual ~ mimeIOTQFile (); virtual int outputLine (const TQCString &, int len = -1); virtual int inputLine (TQCString &); @@ -56,11 +56,11 @@ protected: TQFile myFile; }; -class mimeIOQString:public mimeIO +class mimeIOTQString:public mimeIO { public: - mimeIOQString (); - virtual ~ mimeIOQString (); + mimeIOTQString (); + virtual ~ mimeIOTQString (); virtual int outputLine (const TQCString &, int len = -1); virtual int inputLine (TQCString &); const TQString& getString () const diff --git a/kioslaves/imap4/rfcdecoder.cc b/kioslaves/imap4/rfcdecoder.cc index 5470901ed..46500fad0 100644 --- a/kioslaves/imap4/rfcdecoder.cc +++ b/kioslaves/imap4/rfcdecoder.cc @@ -37,7 +37,7 @@ // adapted to QT-Toolkit by Sven Carstens 2000 static unsigned char base64chars[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,"; + "ABCDEFGHIJKLMNOPTQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,"; #define UNDEFINED 64 #define MAXLINE 76 @@ -315,7 +315,7 @@ rfcDecoder::codecForName (const TQString & _str) } //----------------------------------------------------------------------------- -const QString +const TQString rfcDecoder::decodeRFC2047String (const TQString & _str) { TQString throw_away; @@ -324,7 +324,7 @@ rfcDecoder::decodeRFC2047String (const TQString & _str) } //----------------------------------------------------------------------------- -const QString +const TQString rfcDecoder::decodeRFC2047String (const TQString & _str, TQString & charset) { TQString throw_away; @@ -333,12 +333,12 @@ rfcDecoder::decodeRFC2047String (const TQString & _str, TQString & charset) } //----------------------------------------------------------------------------- -const QString +const TQString rfcDecoder::decodeRFC2047String (const TQString & _str, TQString & charset, TQString & language) { //do we have a rfc string - if (_str.find("=?") < 0) + if (_str.tqfind("=?") < 0) return _str; TQCString aStr = _str.ascii (); // TQString.length() means Unicode chars @@ -457,7 +457,7 @@ rfcDecoder::decodeRFC2047String (const TQString & _str, TQString & charset, //----------------------------------------------------------------------------- const char especials[17] = "()<>@,;:\"/[]?.= "; -const QString +const TQString rfcDecoder::encodeRFC2047String (const TQString & _str) { if (_str.isEmpty ()) @@ -571,7 +571,7 @@ rfcDecoder::encodeRFC2047String (const TQString & _str) //----------------------------------------------------------------------------- -const QString +const TQString rfcDecoder::encodeRFC2231String (const TQString & _str) { if (_str.isEmpty ()) @@ -625,10 +625,10 @@ rfcDecoder::encodeRFC2231String (const TQString & _str) //----------------------------------------------------------------------------- -const QString +const TQString rfcDecoder::decodeRFC2231String (const TQString & _str) { - int p = _str.find ('\''); + int p = _str.tqfind ('\''); //see if it is an rfc string if (p < 0) diff --git a/kioslaves/mbox/mboxfile.cc b/kioslaves/mbox/mboxfile.cc index 271b71019..3c6c6cc7a 100644 --- a/kioslaves/mbox/mboxfile.cc +++ b/kioslaves/mbox/mboxfile.cc @@ -20,9 +20,9 @@ #include -MBoxFile::MBoxFile( const UrlInfo* info, MBoxProtocol* parent ) +MBoxFile::MBoxFile( const UrlInfo* info, MBoxProtocol* tqparent ) : m_info( info ), - m_mbox( parent ) + m_mbox( tqparent ) { assert( m_info ); } diff --git a/kioslaves/mbox/mboxfile.h b/kioslaves/mbox/mboxfile.h index b8a98973e..a628e3817 100644 --- a/kioslaves/mbox/mboxfile.h +++ b/kioslaves/mbox/mboxfile.h @@ -32,9 +32,9 @@ public: /** * Constructor * @param info The urlinfo which must be used - * @param parent The MBoxProtocol parent instance, used to throw errors. + * @param tqparent The MBoxProtocol tqparent instance, used to throw errors. */ - MBoxFile( const UrlInfo* info, MBoxProtocol* parent ); + MBoxFile( const UrlInfo* info, MBoxProtocol* tqparent ); /** * Empty destructor @@ -61,7 +61,7 @@ protected: const UrlInfo* const m_info; /** - * A instance of the parent protocol, meant to throw errors if neccesairy. + * A instance of the tqparent protocol, meant to throw errors if neccesairy. */ MBoxProtocol* const m_mbox; }; diff --git a/kioslaves/mbox/readmbox.cc b/kioslaves/mbox/readmbox.cc index 7cf67e32f..32f52d5b3 100644 --- a/kioslaves/mbox/readmbox.cc +++ b/kioslaves/mbox/readmbox.cc @@ -37,12 +37,12 @@ #include -ReadMBox::ReadMBox( const UrlInfo* info, MBoxProtocol* parent, bool onlynew, bool savetime ) - : MBoxFile( info, parent ), +ReadMBox::ReadMBox( const UrlInfo* info, MBoxProtocol* tqparent, bool onlynew, bool savetime ) + : MBoxFile( info, tqparent ), m_file( 0 ), m_stream( 0 ), - m_current_line( new TQString( TQString::null ) ), - m_current_id( new TQString( TQString::null ) ), + m_current_line( new TQString( TQString() ) ), + m_current_id( new TQString( TQString() ) ), m_atend( true ), m_prev_time( 0 ), m_only_new( onlynew ), @@ -88,7 +88,7 @@ bool ReadMBox::nextLine() m_atend = m_current_line->isNull(); if( m_atend ) // Cursor was at EOF { - *m_current_id = TQString::null; + *m_current_id = TQString(); m_prev_status = m_status; return true; } @@ -103,7 +103,7 @@ bool ReadMBox::nextLine() return true; } else if( m_only_new ) { - if( m_header && m_current_line->left( 7 ) == "Status:" && + if( m_header && m_current_line->left( 7 ) == "tqStatus:" && ! m_current_line->tqcontains( "U" ) && ! m_current_line->tqcontains( "N" ) ) { m_status = false; @@ -145,7 +145,7 @@ void ReadMBox::rewind() if( !m_stream ) return; //Rewinding not possible - m_stream->device()->reset(); + m_stream->tqdevice()->reset(); m_atend = m_stream->atEnd(); } diff --git a/kioslaves/mbox/readmbox.h b/kioslaves/mbox/readmbox.h index 0f7c4d836..ea63068ca 100644 --- a/kioslaves/mbox/readmbox.h +++ b/kioslaves/mbox/readmbox.h @@ -40,11 +40,11 @@ public: * Constructor * * @param info The information of the file to read - * @param parent The instance of the parent MBoxProtocol. + * @param tqparent The instance of the tqparent MBoxProtocol. * @param onlynew Only read new messages from the MBox file. * @param savetime If true, the atime of the mbox-file is preserved (note that this touch the ctime). */ - ReadMBox( const UrlInfo* info, MBoxProtocol* parent, bool onlynew = false, bool savetime = false ); + ReadMBox( const UrlInfo* info, MBoxProtocol* tqparent, bool onlynew = false, bool savetime = false ); /** * Destructor @@ -53,14 +53,14 @@ public: /** * This functions return the current line - * @return The line last read, or TQString::null if there wasn't such last line + * @return The line last read, or TQString() if there wasn't such last line */ TQString currentLine() const; /** * This function returns the current id. The id is the first line of an email, * and is used in filenaming. The id normally starts with "From ". - * @return The current ID, or TQString::null if no id was found yet. + * @return The current ID, or TQString() if no id was found yet. */ TQString currentID() const; diff --git a/kioslaves/mbox/stat.cc b/kioslaves/mbox/stat.cc index c34f0bceb..00285b149 100644 --- a/kioslaves/mbox/stat.cc +++ b/kioslaves/mbox/stat.cc @@ -107,7 +107,7 @@ void Stat::addAtom( KIO::UDSEntry& entry, unsigned int uds, long lng ) { KIO::UDSAtom atom; atom.m_uds = uds; - atom.m_str = TQString::null; + atom.m_str = TQString(); atom.m_long = lng; entry.append( atom ); diff --git a/kioslaves/mbox/urlinfo.cc b/kioslaves/mbox/urlinfo.cc index 2153afb13..d59c77ac8 100644 --- a/kioslaves/mbox/urlinfo.cc +++ b/kioslaves/mbox/urlinfo.cc @@ -101,7 +101,7 @@ bool UrlInfo::isDirectory( const KURL& url ) //Setting paramaters *m_filename = filename; - *m_id = TQString::null; + *m_id = TQString(); m_type = directory; kdDebug() << "urlInfo::isDirectory( " << url << " )" << endl; return true; diff --git a/kioslaves/mbox/urlinfo.h b/kioslaves/mbox/urlinfo.h index b15f64fb1..96882d1db 100644 --- a/kioslaves/mbox/urlinfo.h +++ b/kioslaves/mbox/urlinfo.h @@ -64,7 +64,7 @@ public: TQString id() const; /** - * @return the while url as QString + * @return the while url as TQString */ TQString url() const; private: diff --git a/kioslaves/opengroupware/opengroupware.h b/kioslaves/opengroupware/opengroupware.h index 1a7b143e7..3f48ff882 100644 --- a/kioslaves/opengroupware/opengroupware.h +++ b/kioslaves/opengroupware/opengroupware.h @@ -33,6 +33,7 @@ namespace KIO { class OpenGroupware : public TQObject, public KIO::SlaveBase { Q_OBJECT + TQ_OBJECT public: OpenGroupware( const TQCString &protocol, const TQCString &pool, const TQCString &app ); diff --git a/kioslaves/opengroupware/webdavhandler.cpp b/kioslaves/opengroupware/webdavhandler.cpp index 1177624c5..61f2d6b53 100644 --- a/kioslaves/opengroupware/webdavhandler.cpp +++ b/kioslaves/opengroupware/webdavhandler.cpp @@ -70,7 +70,7 @@ TQDomDocument WebdavHandler::createAllPropsRequest() { TQDomDocument doc; - TQDomElement root = WebdavHandler::addDavElement( doc, doc, "propfind" ); + TQDomElement root = WebdavHandler::addDavElement( doc, doc, "proptqfind" ); TQDomElement prop = WebdavHandler::addDavElement( doc, root, "prop" ); WebdavHandler::addDavElement( doc, prop, "getcontentlength"); WebdavHandler::addDavElement( doc, prop, "getlastmodified" ); diff --git a/kioslaves/opengroupware/webdavhandler.h b/kioslaves/opengroupware/webdavhandler.h index 367ff3aa3..eebb7b03b 100644 --- a/kioslaves/opengroupware/webdavhandler.h +++ b/kioslaves/opengroupware/webdavhandler.h @@ -37,7 +37,7 @@ class WebdavHandler const TQString &tag ); static TQDomElement addSloxElement( TQDomDocument &, TQDomNode &, const TQString &tag, - const TQString &text = TQString::null ); + const TQString &text = TQString() ); static TQDomDocument createAllPropsRequest(); }; diff --git a/kioslaves/sieve/sieve.cpp b/kioslaves/sieve/sieve.cpp index 6d2f90b8b..802b3cdc8 100644 --- a/kioslaves/sieve/sieve.cpp +++ b/kioslaves/sieve/sieve.cpp @@ -149,10 +149,10 @@ const TQCString& kio_sieveResponse::getExtra() const } /* ---------------------------------------------------------------------------------- */ -void kio_sieveResponse::setQuantity(const uint& newQty) +void kio_sieveResponse::setQuantity(const uint& newTQty) { - rType = QUANTITY; - quantity = newQty; + rType = TQUANTITY; + quantity = newTQty; } /* ---------------------------------------------------------------------------------- */ @@ -453,7 +453,7 @@ void kio_sieveProtocol::disconnect(bool forcibly) /* ---------------------------------------------------------------------------------- */ /*void kio_sieveProtocol::slave_status() { - slaveStatus(isConnectionValid() ? m_sServer : "", isConnectionValid()); + slavetqStatus(isConnectionValid() ? m_sServer : "", isConnectionValid()); finished(); }*/ @@ -661,7 +661,7 @@ void kio_sieveProtocol::put(const KURL& url, int /*permissions*/, bool /*overwri // send the extra message off for re-processing receiveData(false, &extra); - if (r.getType() == kio_sieveResponse::QUANTITY) { + if (r.getType() == kio_sieveResponse::TQUANTITY) { // length of the error message uint len = r.getQuantity(); @@ -736,7 +736,7 @@ void kio_sieveProtocol::get(const KURL& url) if (!sendData("GETSCRIPT \"" + filename.utf8() + "\"")) return; - if (receiveData() && r.getType() == kio_sieveResponse::QUANTITY) { + if (receiveData() && r.getType() == kio_sieveResponse::TQUANTITY) { // determine script size ssize_t total_len = r.getQuantity(); totalSize( total_len ); @@ -1105,7 +1105,7 @@ bool kio_sieveProtocol::authenticate() ksDebug() << "Challenge len " << r.getQuantity() << endl; - if (r.getType() != kio_sieveResponse::QUANTITY) { + if (r.getType() != kio_sieveResponse::TQUANTITY) { sasl_dispose( &conn ); error(ERR_SLAVE_DEFINED, i18n("A protocol error occurred during authentication.\n" @@ -1237,10 +1237,10 @@ bool kio_sieveProtocol::receiveData(bool waitForData, TQCString *reparse) { // expecting {quantity} start = 0; - end = interpret.find("+}", start + 1); + end = interpret.tqfind("+}", start + 1); // some older versions of Cyrus enclose the literal size just in { } instead of { +} if ( end == -1 ) - end = interpret.find('}', start + 1); + end = interpret.tqfind('}', start + 1); bool ok = false; r.setQuantity(interpret.mid(start + 1, end - start - 1).toUInt( &ok )); @@ -1263,7 +1263,7 @@ bool kio_sieveProtocol::receiveData(bool waitForData, TQCString *reparse) start = 0; - end = interpret.find(34, start + 1); + end = interpret.tqfind(34, start + 1); if (end == -1) { ksDebug() << "Possible insufficient buffer size." << endl; r.setKey(interpret.right(interpret.length() - start)); @@ -1272,7 +1272,7 @@ bool kio_sieveProtocol::receiveData(bool waitForData, TQCString *reparse) r.setKey(interpret.mid(start + 1, end - start - 1)); - start = interpret.find(34, end + 1); + start = interpret.tqfind(34, end + 1); if (start == -1) { if ((int)interpret.length() > end) // skip " and space @@ -1281,7 +1281,7 @@ bool kio_sieveProtocol::receiveData(bool waitForData, TQCString *reparse) return true; } - end = interpret.find(34, start + 1); + end = interpret.tqfind(34, start + 1); if (end == -1) { ksDebug() << "Possible insufficient buffer size." << endl; r.setVal(interpret.right(interpret.length() - start)); diff --git a/kioslaves/sieve/sieve.h b/kioslaves/sieve/sieve.h index 0fc3bbd68..4a22cbe14 100644 --- a/kioslaves/sieve/sieve.h +++ b/kioslaves/sieve/sieve.h @@ -30,7 +30,7 @@ class KURL; class kio_sieveResponse { public: - enum responses { NONE, KEY_VAL_PAIR, ACTION, QUANTITY }; + enum responses { NONE, KEY_VAL_PAIR, ACTION, TQUANTITY }; kio_sieveResponse(); @@ -53,9 +53,9 @@ public: protected: uint rType; uint quantity; - QCString key; - QCString val; - QCString extra; + TQCString key; + TQCString val; + TQCString extra; }; class kio_sieveProtocol : public KIO::TCPSlaveBase @@ -110,17 +110,17 @@ protected: uint m_connMode; // Host-specific data - QStringList m_sasl_caps; + TQStringList m_sasl_caps; bool m_supportsTLS; // Global server respose class kio_sieveResponse r; // connection details - QString m_sServer; - QString m_sUser; - QString m_sPass; - QString m_sAuth; + TQString m_sServer; + TQString m_sUser; + TQString m_sPass; + TQString m_sAuth; bool m_shouldBeConnected; bool m_allowUnencrypted; -- cgit v1.2.1