summaryrefslogtreecommitdiffstats
path: root/kioslaves/imap4/imap4.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kioslaves/imap4/imap4.cc')
-rw-r--r--kioslaves/imap4/imap4.cc122
1 files changed, 61 insertions, 61 deletions
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 {