summaryrefslogtreecommitdiffstats
path: root/kioslaves/imap4/mimeheader.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kioslaves/imap4/mimeheader.cc
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kioslaves/imap4/mimeheader.cc')
-rw-r--r--kioslaves/imap4/mimeheader.cc148
1 files changed, 74 insertions, 74 deletions
diff --git a/kioslaves/imap4/mimeheader.cc b/kioslaves/imap4/mimeheader.cc
index 17d3a3fd8..676e0d72f 100644
--- a/kioslaves/imap4/mimeheader.cc
+++ b/kioslaves/imap4/mimeheader.cc
@@ -20,7 +20,7 @@
#include "mailheader.h"
#include "rfcdecoder.h"
-#include <qregexp.h>
+#include <tqregexp.h>
// #include <iostream.h>
#include <kglobal.h>
@@ -50,9 +50,9 @@ mimeHeader::~mimeHeader ()
}
/*
-QPtrList<mimeHeader> mimeHeader::getAllParts()
+TQPtrList<mimeHeader> mimeHeader::getAllParts()
{
- QPtrList<mimeHeader> retVal;
+ TQPtrList<mimeHeader> retVal;
// caller is responsible for clearing
retVal.setAutoDelete( false );
@@ -85,7 +85,7 @@ mimeHeader::addHdrLine (mimeHdrLine * aHdrLine)
{
int skip;
char *aCStr = addLine->getValue ().data ();
- QDict < QString > *aList = 0;
+ TQDict < TQString > *aList = 0;
skip = mimeHdrLine::parseSeparator (';', aCStr);
if (skip > 0)
@@ -102,7 +102,7 @@ mimeHeader::addHdrLine (mimeHdrLine * aHdrLine)
if (aCStr[skip - 1] == ';')
cut++;
}
- QCString mimeValue = QCString (aCStr, skip - cut + 1); // cutting of one because of 0x00
+ TQCString mimeValue = TQCString (aCStr, skip - cut + 1); // cutting of one because of 0x00
if (!qstricmp (addLine->getLabel (), "Content-Disposition"))
@@ -147,9 +147,9 @@ mimeHeader::addHdrLine (mimeHdrLine * aHdrLine)
{
if (skip > 0)
{
- addParameter (QCString (aCStr, skip).simplifyWhiteSpace(), aList);
+ addParameter (TQCString (aCStr, skip).simplifyWhiteSpace(), aList);
// cout << "-- '" << aParm.data() << "'" << endl;
- mimeValue = QCString (addLine->getValue ().data (), skip);
+ mimeValue = TQCString (addLine->getValue ().data (), skip);
aCStr += skip;
}
else
@@ -161,16 +161,16 @@ mimeHeader::addHdrLine (mimeHdrLine * aHdrLine)
}
void
-mimeHeader::addParameter (const QCString& aParameter, QDict < QString > *aList)
+mimeHeader::addParameter (const TQCString& aParameter, TQDict < TQString > *aList)
{
if ( !aList )
return;
- QString *aValue;
- QCString aLabel;
+ TQString *aValue;
+ TQCString aLabel;
int pos = aParameter.find ('=');
// cout << aParameter.left(pos).data();
- aValue = new QString ();
+ aValue = new TQString ();
aValue->setLatin1 (aParameter.right (aParameter.length () - pos - 1));
aLabel = aParameter.left (pos);
if ((*aValue)[0] == '"')
@@ -181,48 +181,48 @@ mimeHeader::addParameter (const QCString& aParameter, QDict < QString > *aList)
}
QString
-mimeHeader::getDispositionParm (const QCString& aStr)
+mimeHeader::getDispositionParm (const TQCString& aStr)
{
return getParameter (aStr, &dispositionList);
}
QString
-mimeHeader::getTypeParm (const QCString& aStr)
+mimeHeader::getTypeParm (const TQCString& aStr)
{
return getParameter (aStr, &typeList);
}
void
-mimeHeader::setDispositionParm (const QCString& aLabel, const QString& aValue)
+mimeHeader::setDispositionParm (const TQCString& aLabel, const TQString& aValue)
{
setParameter (aLabel, aValue, &dispositionList);
return;
}
void
-mimeHeader::setTypeParm (const QCString& aLabel, const QString& aValue)
+mimeHeader::setTypeParm (const TQCString& aLabel, const TQString& aValue)
{
setParameter (aLabel, aValue, &typeList);
}
-QDictIterator < QString > mimeHeader::getDispositionIterator ()
+TQDictIterator < TQString > mimeHeader::getDispositionIterator ()
{
- return QDictIterator < QString > (dispositionList);
+ return TQDictIterator < TQString > (dispositionList);
}
-QDictIterator < QString > mimeHeader::getTypeIterator ()
+TQDictIterator < TQString > mimeHeader::getTypeIterator ()
{
- return QDictIterator < QString > (typeList);
+ return TQDictIterator < TQString > (typeList);
}
-QPtrListIterator < mimeHdrLine > mimeHeader::getOriginalIterator ()
+TQPtrListIterator < mimeHdrLine > mimeHeader::getOriginalIterator ()
{
- return QPtrListIterator < mimeHdrLine > (originalHdrLines);
+ return TQPtrListIterator < mimeHdrLine > (originalHdrLines);
}
-QPtrListIterator < mimeHdrLine > mimeHeader::getAdditionalIterator ()
+TQPtrListIterator < mimeHdrLine > mimeHeader::getAdditionalIterator ()
{
- return QPtrListIterator < mimeHdrLine > (additionalHdrLines);
+ return TQPtrListIterator < mimeHdrLine > (additionalHdrLines);
}
void
@@ -230,41 +230,41 @@ mimeHeader::outputHeader (mimeIO & useIO)
{
if (!getDisposition ().isEmpty ())
{
- useIO.outputMimeLine (QCString ("Content-Disposition: ")
+ useIO.outputMimeLine (TQCString ("Content-Disposition: ")
+ getDisposition ()
+ outputParameter (&dispositionList));
}
if (!getType ().isEmpty ())
{
- useIO.outputMimeLine (QCString ("Content-Type: ")
+ useIO.outputMimeLine (TQCString ("Content-Type: ")
+ getType () + outputParameter (&typeList));
}
if (!getDescription ().isEmpty ())
- useIO.outputMimeLine (QCString ("Content-Description: ") +
+ useIO.outputMimeLine (TQCString ("Content-Description: ") +
getDescription ());
if (!getID ().isEmpty ())
- useIO.outputMimeLine (QCString ("Content-ID: ") + getID ());
+ useIO.outputMimeLine (TQCString ("Content-ID: ") + getID ());
if (!getMD5 ().isEmpty ())
- useIO.outputMimeLine (QCString ("Content-MD5: ") + getMD5 ());
+ useIO.outputMimeLine (TQCString ("Content-MD5: ") + getMD5 ());
if (!getEncoding ().isEmpty ())
- useIO.outputMimeLine (QCString ("Content-Transfer-Encoding: ") +
+ useIO.outputMimeLine (TQCString ("Content-Transfer-Encoding: ") +
getEncoding ());
- QPtrListIterator < mimeHdrLine > ait = getAdditionalIterator ();
+ TQPtrListIterator < mimeHdrLine > ait = getAdditionalIterator ();
while (ait.current ())
{
useIO.outputMimeLine (ait.current ()->getLabel () + ": " +
ait.current ()->getValue ());
++ait;
}
- useIO.outputMimeLine (QCString (""));
+ useIO.outputMimeLine (TQCString (""));
}
QString
-mimeHeader::getParameter (const QCString& aStr, QDict < QString > *aDict)
+mimeHeader::getParameter (const TQCString& aStr, TQDict < TQString > *aDict)
{
- QString retVal, *found;
+ TQString retVal, *found;
if (aDict)
{
//see if it is a normal parameter
@@ -276,12 +276,12 @@ mimeHeader::getParameter (const QCString& aStr, QDict < QString > *aDict)
if (!found)
{
//continuated parameter
- QString decoded, encoded;
+ TQString decoded, encoded;
int part = 0;
do
{
- QCString search;
+ TQCString search;
search.setNum (part);
search = aStr + "*" + search;
found = aDict->find (search);
@@ -305,7 +305,7 @@ mimeHeader::getParameter (const QCString& aStr, QDict < QString > *aDict)
else
{
retVal =
- rfcDecoder::decodeRFC2231String (QCString ("''") +
+ rfcDecoder::decodeRFC2231String (TQCString ("''") +
encoded.local8Bit ());
}
}
@@ -324,12 +324,12 @@ mimeHeader::getParameter (const QCString& aStr, QDict < QString > *aDict)
}
void
-mimeHeader::setParameter (const QCString& aLabel, const QString& aValue,
- QDict < QString > *aDict)
+mimeHeader::setParameter (const TQCString& aLabel, const TQString& aValue,
+ TQDict < TQString > *aDict)
{
bool encoded = true;
uint vlen, llen;
- QString val = aValue;
+ TQString val = aValue;
if (aDict)
{
@@ -350,8 +350,8 @@ mimeHeader::setParameter (const QCString& aLabel, const QString& aValue,
// by 1 or 2 in order to prevent an encoded character from being
// split in half
int i = 0;
- QString shortValue;
- QCString shortLabel;
+ TQString shortValue;
+ TQCString shortLabel;
while (!val.isEmpty ())
{
@@ -391,24 +391,24 @@ mimeHeader::setParameter (const QCString& aLabel, const QString& aValue,
//kdDebug(7116) << "mimeHeader::setParameter() - shortLabel = '" << shortLabel << "'" << endl;
//kdDebug(7116) << "mimeHeader::setParameter() - shortValue = '" << shortValue << "'" << endl;
//kdDebug(7116) << "mimeHeader::setParameter() - val = '" << val << "'" << endl;
- aDict->insert (shortLabel, new QString (shortValue));
+ aDict->insert (shortLabel, new TQString (shortValue));
i++;
}
}
else
{
- aDict->insert (aLabel, new QString (val));
+ aDict->insert (aLabel, new TQString (val));
}
}
}
QCString
-mimeHeader::outputParameter (QDict < QString > *aDict)
+mimeHeader::outputParameter (TQDict < TQString > *aDict)
{
- QCString retVal;
+ TQCString retVal;
if (aDict)
{
- QDictIterator < QString > it (*aDict);
+ TQDictIterator < TQString > it (*aDict);
while (it.current ())
{
retVal += (";\n\t" + it.currentKey () + "=").latin1 ();
@@ -431,8 +431,8 @@ mimeHeader::outputParameter (QDict < QString > *aDict)
void
mimeHeader::outputPart (mimeIO & useIO)
{
- QPtrListIterator < mimeHeader > nestedParts = getNestedIterator ();
- QCString boundary;
+ TQPtrListIterator < mimeHeader > nestedParts = getNestedIterator ();
+ TQCString boundary;
if (!getTypeParm ("boundary").isEmpty ())
boundary = getTypeParm ("boundary").latin1 ();
@@ -455,11 +455,11 @@ mimeHeader::outputPart (mimeIO & useIO)
}
int
-mimeHeader::parsePart (mimeIO & useIO, const QString& boundary)
+mimeHeader::parsePart (mimeIO & useIO, const TQString& boundary)
{
int retVal = 0;
bool mbox = false;
- QCString preNested, postNested;
+ TQCString preNested, postNested;
mbox = parseHeader (useIO);
kdDebug(7116) << "mimeHeader::parsePart - parsing part '" << getType () << "'" << endl;
@@ -496,19 +496,19 @@ mimeHeader::parsePart (mimeIO & useIO, const QString& boundary)
}
int
-mimeHeader::parseBody (mimeIO & useIO, QCString & messageBody,
- const QString& boundary, bool mbox)
+mimeHeader::parseBody (mimeIO & useIO, TQCString & messageBody,
+ const TQString& boundary, bool mbox)
{
- QCString inputStr;
- QCString buffer;
- QString partBoundary;
- QString partEnd;
+ TQCString inputStr;
+ TQCString buffer;
+ TQString partBoundary;
+ TQString partEnd;
int retVal = 0; //default is last part
if (!boundary.isEmpty ())
{
- partBoundary = QString ("--") + boundary;
- partEnd = QString ("--") + boundary + "--";
+ partBoundary = TQString ("--") + boundary;
+ partEnd = TQString ("--") + boundary + "--";
}
while (useIO.inputLine (inputStr))
@@ -550,7 +550,7 @@ mimeHeader::parseHeader (mimeIO & useIO)
bool mbox = false;
bool first = true;
mimeHdrLine my_line;
- QCString inputStr;
+ TQCString inputStr;
kdDebug(7116) << "mimeHeader::parseHeader - starting parsing" << endl;
while (useIO.inputLine (inputStr))
@@ -581,13 +581,13 @@ mimeHeader::parseHeader (mimeIO & useIO)
}
mimeHeader *
-mimeHeader::bodyPart (const QString & _str)
+mimeHeader::bodyPart (const TQString & _str)
{
// see if it is nested a little deeper
int pt = _str.find('.');
if (pt != -1)
{
- QString tempStr = _str;
+ TQString tempStr = _str;
mimeHeader *tempPart;
tempStr = _str.right (_str.length () - pt - 1);
@@ -617,12 +617,12 @@ mimeHeader::bodyPart (const QString & _str)
return nestedParts.at (_str.toULong () - 1);
}
-void mimeHeader::serialize(QDataStream& stream)
+void mimeHeader::serialize(TQDataStream& stream)
{
int nestedcount = nestedParts.count();
if (nestedParts.isEmpty() && nestedMessage)
nestedcount = 1;
- stream << nestedcount << contentType << QString (getTypeParm ("name")) << _contentDescription
+ stream << nestedcount << contentType << TQString (getTypeParm ("name")) << _contentDescription
<< _contentDisposition << contentEncoding << contentLength << partSpecifier;
// serialize nested message
if (nestedMessage)
@@ -631,7 +631,7 @@ void mimeHeader::serialize(QDataStream& stream)
// serialize nested parts
if (!nestedParts.isEmpty())
{
- QPtrListIterator < mimeHeader > it(nestedParts);
+ TQPtrListIterator < mimeHeader > it(nestedParts);
mimeHeader* part;
while ( (part = it.current()) != 0 )
{
@@ -647,16 +647,16 @@ QString
mimeHeader::bodyDecoded ()
{
kdDebug(7116) << "mimeHeader::bodyDecoded" << endl;
- QByteArray temp;
+ TQByteArray temp;
temp = bodyDecodedBinary ();
- return QString::fromLatin1 (temp.data (), temp.count ());
+ return TQString::fromLatin1 (temp.data (), temp.count ());
}
QByteArray
mimeHeader::bodyDecodedBinary ()
{
- QByteArray retVal;
+ TQByteArray retVal;
if (contentEncoding.find ("quoted-printable", 0, false) == 0)
retVal = KCodecs::quotedPrintableDecode(postMultipartBody);
@@ -669,15 +669,15 @@ mimeHeader::bodyDecodedBinary ()
}
void
-mimeHeader::setBodyEncodedBinary (const QByteArray & _arr)
+mimeHeader::setBodyEncodedBinary (const TQByteArray & _arr)
{
setBodyEncoded (_arr);
}
void
-mimeHeader::setBodyEncoded (const QByteArray & _arr)
+mimeHeader::setBodyEncoded (const TQByteArray & _arr)
{
- QByteArray setVal;
+ TQByteArray setVal;
kdDebug(7116) << "mimeHeader::setBodyEncoded - in size " << _arr.size () << endl;
if (contentEncoding.find ("quoted-printable", 0, false) == 0)
@@ -695,11 +695,11 @@ mimeHeader::setBodyEncoded (const QByteArray & _arr)
QString
mimeHeader::iconName ()
{
- QString fileName;
+ TQString fileName;
// FIXME: bug? Why throw away this data?
fileName =
- KMimeType::mimeType (contentType.lower ())->icon (QString::null, false);
+ KMimeType::mimeType (contentType.lower ())->icon (TQString::null, false);
fileName =
KGlobal::instance ()->iconLoader ()->iconPath (fileName, KIcon::Desktop);
// if (fileName.isEmpty())
@@ -726,8 +726,8 @@ mimeHeader::headerAsString ()
QString
mimeHeader::magicSetType (bool aAutoDecode)
{
- QString mimetype;
- QByteArray body;
+ TQString mimetype;
+ TQByteArray body;
KMimeMagicResult *result;
KMimeMagic::self ()->setFollowLinks (TRUE); // is it necessary ?