diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/msn/messageformatter.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/msn/messageformatter.cpp')
-rw-r--r-- | kopete/protocols/msn/messageformatter.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/kopete/protocols/msn/messageformatter.cpp b/kopete/protocols/msn/messageformatter.cpp index 3a698ac4..7d830ea6 100644 --- a/kopete/protocols/msn/messageformatter.cpp +++ b/kopete/protocols/msn/messageformatter.cpp @@ -17,8 +17,8 @@ #include "p2p.h" // Qt includes -#include <qdatastream.h> -#include <qregexp.h> +#include <tqdatastream.h> +#include <tqregexp.h> // Kde includes #include <kdebug.h> @@ -26,13 +26,13 @@ using P2P::MessageFormatter; using P2P::Message; -MessageFormatter::MessageFormatter(QObject *parent, const char *name) : QObject(parent, name) +MessageFormatter::MessageFormatter(TQObject *parent, const char *name) : TQObject(parent, name) {} MessageFormatter::~MessageFormatter() {} -Message MessageFormatter::readMessage(const QByteArray& stream, bool compact) +Message MessageFormatter::readMessage(const TQByteArray& stream, bool compact) { Message inbound; @@ -49,30 +49,30 @@ Message MessageFormatter::readMessage(const QByteArray& stream, bool compact) } // Retrieve the message header. - QString messageHeader = QCString(stream.data(), index); + TQString messageHeader = TQCString(stream.data(), index); // Retrieve the message mime version, content type, // and p2p destination. - QRegExp regex("Content-Type: ([A-Za-z0-9$!*/\\-]*)"); + TQRegExp regex("Content-Type: ([A-Za-z0-9$!*/\\-]*)"); regex.search(messageHeader); - QString contentType = regex.cap(1); + TQString contentType = regex.cap(1); if(contentType != "application/x-msnmsgrp2p") return inbound; // kdDebug(14140) << k_funcinfo << endl; - regex = QRegExp("MIME-Version: (\\d.\\d)"); + regex = TQRegExp("MIME-Version: (\\d.\\d)"); regex.search(messageHeader); inbound.mimeVersion = regex.cap(1); inbound.contentType = contentType; - regex = QRegExp("P2P-Dest: ([^\r\n]*)"); + regex = TQRegExp("P2P-Dest: ([^\r\n]*)"); regex.search(messageHeader); - QString destination = regex.cap(1); + TQString destination = regex.cap(1); } - QDataStream reader(stream, IO_ReadOnly); - reader.setByteOrder(QDataStream::LittleEndian); + TQDataStream reader(stream, IO_ReadOnly); + reader.setByteOrder(TQDataStream::LittleEndian); // Seek to the start position of the message // transport header. reader.device()->at(index); @@ -108,7 +108,7 @@ Message MessageFormatter::readMessage(const QByteArray& stream, bool compact) if(compact == false) { - reader.setByteOrder(QDataStream::BigEndian); + reader.setByteOrder(TQDataStream::BigEndian); // Read the message application identifier from the stream. reader >> inbound.applicationIdentifier; @@ -120,16 +120,16 @@ Message MessageFormatter::readMessage(const QByteArray& stream, bool compact) return inbound; } -void MessageFormatter::writeMessage(const Message& message, QByteArray& stream, bool compact) +void MessageFormatter::writeMessage(const Message& message, TQByteArray& stream, bool compact) { // kdDebug(14140) << k_funcinfo << endl; - QDataStream writer(stream, IO_WriteOnly); - writer.setByteOrder(QDataStream::LittleEndian); + TQDataStream writer(stream, IO_WriteOnly); + writer.setByteOrder(TQDataStream::LittleEndian); if(compact == false) { - const QCString messageHeader = QString("MIME-Version: 1.0\r\n" + const TQCString messageHeader = TQString("MIME-Version: 1.0\r\n" "Content-Type: application/x-msnmsgrp2p\r\n" "P2P-Dest: " + message.destination + "\r\n" "\r\n").utf8(); @@ -178,7 +178,7 @@ void MessageFormatter::writeMessage(const Message& message, QByteArray& stream, if(compact == false) { // Seek to the message application identifier section. - writer.setByteOrder(QDataStream::BigEndian); + writer.setByteOrder(TQDataStream::BigEndian); // Write the message application identifier to the stream. writer << message.applicationIdentifier; |