summaryrefslogtreecommitdiffstats
path: root/korn/mailsubject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'korn/mailsubject.cpp')
-rw-r--r--korn/mailsubject.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/korn/mailsubject.cpp b/korn/mailsubject.cpp
index 1f2011a02..d431f4402 100644
--- a/korn/mailsubject.cpp
+++ b/korn/mailsubject.cpp
@@ -5,8 +5,8 @@
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
-#include <qdatetime.h>
-#include <qtextcodec.h>
+#include <tqdatetime.h>
+#include <tqtextcodec.h>
#include <ctype.h>
KornMailSubject::KornMailSubject() : _id(0), _drop(0), _size(-1), _date(-1), _fullMessage(false)
@@ -48,32 +48,32 @@ KornMailSubject::~KornMailSubject()
_id = 0;
}
-QString KornMailSubject::toString() const
+TQString KornMailSubject::toString() const
{
- QDateTime date;
+ TQDateTime date;
date.setTime_t(_date);
- return QString("KornMailSubject, Id: ") + (_id?_id->toString():QString("NULL")) + ", " + i18n("Subject:") + " " + _subject
- + ", " + i18n("Sender:") + " " + _sender + ", " + i18n("Size:") + " " + QString::number(_size)
+ return TQString("KornMailSubject, Id: ") + (_id?_id->toString():TQString("NULL")) + ", " + i18n("Subject:") + " " + _subject
+ + ", " + i18n("Sender:") + " " + _sender + ", " + i18n("Size:") + " " + TQString::number(_size)
+ ", " + i18n("Date:") + " " + date.toString(Qt::ISODate);
}
-QString KornMailSubject::decodeRFC2047String(const QCString& aStr)
+TQString KornMailSubject::decodeRFC2047String(const TQCString& aStr)
{
if ( aStr.isEmpty() )
- return QString::null;
+ return TQString::null;
- const QCString str = unfold( aStr );
+ const TQCString str = unfold( aStr );
if ( str.isEmpty() )
- return QString::null;
+ return TQString::null;
if ( str.find( "=?" ) < 0 ) {
// No need to decode
- return QString(str);
+ return TQString(str);
}
- QString result;
- QCString LWSP_buffer;
+ TQString result;
+ TQCString LWSP_buffer;
bool lastWasEncodedWord = false;
for ( const char * pos = str.data() ; *pos ; ++pos ) {
@@ -95,7 +95,7 @@ QString KornMailSubject::decodeRFC2047String(const QCString& aStr)
const char * const beg = pos;
{
// parse charset name
- QCString charset;
+ TQCString charset;
int i = 2;
pos += 2;
for ( ; *pos != '?' && ( *pos==' ' || ispunct(*pos) || isalnum(*pos) ); ++i, ++pos ) {
@@ -123,12 +123,12 @@ QString KornMailSubject::decodeRFC2047String(const QCString& aStr)
const KMime::Codec * c = KMime::Codec::codecForName( encoding );
kdFatal( !c ) << "No \"" << encoding << "\" codec!?" << endl;
- QByteArray in; in.setRawData( enc_start, pos - enc_start );
- const QByteArray enc = c->decode( in );
+ TQByteArray in; in.setRawData( enc_start, pos - enc_start );
+ const TQByteArray enc = c->decode( in );
in.resetRawData( enc_start, pos - enc_start );
- const QTextCodec * codec = codecForName(charset);
- if (!codec) return QString::null;
+ const TQTextCodec * codec = codecForName(charset);
+ if (!codec) return TQString::null;
result += codec->toUnicode(enc);
lastWasEncodedWord = true;
@@ -149,12 +149,12 @@ invalid_encoded_word:
return result;
}
-QCString KornMailSubject::unfold( const QCString & header )
+TQCString KornMailSubject::unfold( const TQCString & header )
{
if ( header.isEmpty() )
- return QCString();
+ return TQCString();
- QCString result( header.size() ); // size() >= length()+1 and size() is O(1)
+ TQCString result( header.size() ); // size() >= length()+1 and size() is O(1)
char * d = result.data();
for ( const char * s = header.data() ; *s ; )
@@ -174,10 +174,10 @@ QCString KornMailSubject::unfold( const QCString & header )
}
//-----------------------------------------------------------------------------
-const QTextCodec* KornMailSubject::codecForName(const QCString& _str)
+const TQTextCodec* KornMailSubject::codecForName(const TQCString& _str)
{
if (_str.isEmpty()) return 0;
- QCString codec = _str;
+ TQCString codec = _str;
return KGlobal::charsets()->codecForName(codec);
}