summaryrefslogtreecommitdiffstats
path: root/kioslaves/imap4/imapparser.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kioslaves/imap4/imapparser.cc
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-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 'kioslaves/imap4/imapparser.cc')
-rw-r--r--kioslaves/imap4/imapparser.cc94
1 files changed, 47 insertions, 47 deletions
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<TQString>::Iterator it = list.begin(); it != list.end(); ++it )
{
- if ( !(*it).isEmpty() && box.find( *it ) != -1 )
+ if ( !(*it).isEmpty() && box.tqfind( *it ) != -1 )
return (*it);
}
}