From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/protocols/msn/config/msnpreferences.cpp | 2 +- kopete/protocols/msn/dispatcher.cpp | 166 ++++++------ kopete/protocols/msn/dispatcher.h | 42 +-- kopete/protocols/msn/incomingtransfer.cpp | 66 ++--- kopete/protocols/msn/incomingtransfer.h | 4 +- kopete/protocols/msn/messageformatter.cpp | 36 +-- kopete/protocols/msn/messageformatter.h | 8 +- kopete/protocols/msn/msnaccount.cpp | 324 +++++++++++------------ kopete/protocols/msn/msnaccount.h | 82 +++--- kopete/protocols/msn/msnaddcontactpage.cpp | 16 +- kopete/protocols/msn/msnaddcontactpage.h | 10 +- kopete/protocols/msn/msnchallengehandler.cpp | 38 +-- kopete/protocols/msn/msnchallengehandler.h | 18 +- kopete/protocols/msn/msnchatsession.cpp | 182 ++++++------- kopete/protocols/msn/msnchatsession.h | 34 +-- kopete/protocols/msn/msncontact.cpp | 108 ++++---- kopete/protocols/msn/msncontact.h | 40 +-- kopete/protocols/msn/msndebugrawcmddlg.cpp | 14 +- kopete/protocols/msn/msndebugrawcmddlg.h | 8 +- kopete/protocols/msn/msnfiletransfersocket.cpp | 102 +++---- kopete/protocols/msn/msnfiletransfersocket.h | 34 +-- kopete/protocols/msn/msninvitation.cpp | 34 +-- kopete/protocols/msn/msninvitation.h | 20 +- kopete/protocols/msn/msnnotifysocket.cpp | 256 +++++++++--------- kopete/protocols/msn/msnnotifysocket.h | 84 +++--- kopete/protocols/msn/msnprotocol.cpp | 44 +-- kopete/protocols/msn/msnprotocol.h | 20 +- kopete/protocols/msn/msnsecureloginhandler.cpp | 28 +- kopete/protocols/msn/msnsecureloginhandler.h | 14 +- kopete/protocols/msn/msnsocket.cpp | 170 ++++++------ kopete/protocols/msn/msnsocket.h | 68 ++--- kopete/protocols/msn/msnswitchboardsocket.cpp | 298 ++++++++++----------- kopete/protocols/msn/msnswitchboardsocket.h | 70 ++--- kopete/protocols/msn/outgoingtransfer.cpp | 68 ++--- kopete/protocols/msn/outgoingtransfer.h | 16 +- kopete/protocols/msn/p2p.cpp | 50 ++-- kopete/protocols/msn/p2p.h | 36 +-- kopete/protocols/msn/sha1.cpp | 16 +- kopete/protocols/msn/sha1.h | 8 +- kopete/protocols/msn/transport.cpp | 60 ++--- kopete/protocols/msn/transport.h | 34 +-- kopete/protocols/msn/ui/msneditaccountwidget.cpp | 90 +++---- kopete/protocols/msn/ui/msneditaccountwidget.h | 6 +- kopete/protocols/msn/webcam.cpp | 196 +++++++------- kopete/protocols/msn/webcam.h | 20 +- kopete/protocols/msn/webcam/mimicwrapper.cpp | 28 +- kopete/protocols/msn/webcam/mimicwrapper.h | 6 +- kopete/protocols/msn/webcam/msnwebcamdialog.cpp | 24 +- kopete/protocols/msn/webcam/msnwebcamdialog.h | 6 +- 49 files changed, 1552 insertions(+), 1552 deletions(-) (limited to 'kopete/protocols/msn') diff --git a/kopete/protocols/msn/config/msnpreferences.cpp b/kopete/protocols/msn/config/msnpreferences.cpp index b28c2ea3..a6f5371f 100644 --- a/kopete/protocols/msn/config/msnpreferences.cpp +++ b/kopete/protocols/msn/config/msnpreferences.cpp @@ -26,7 +26,7 @@ K_EXPORT_COMPONENT_FACTORY( kcm_kopete_msn, MSNProtocolConfigFactory( "kcm_kopet class MSNPreferences : public KCAutoConfigModule { public: - MSNPreferences( QWidget *parent = 0, const char * = 0, const QStringList &args = QStringList() ) : KCAutoConfigModule( MSNProtocolConfigFactory::instance(), parent, args ) + MSNPreferences( TQWidget *parent = 0, const char * = 0, const TQStringList &args = TQStringList() ) : KCAutoConfigModule( MSNProtocolConfigFactory::instance(), parent, args ) { setMainWidget( new msnPrefsUI( this ) , "MSN"); } diff --git a/kopete/protocols/msn/dispatcher.cpp b/kopete/protocols/msn/dispatcher.cpp index 8b8bbed6..fb88e8bc 100644 --- a/kopete/protocols/msn/dispatcher.cpp +++ b/kopete/protocols/msn/dispatcher.cpp @@ -37,11 +37,11 @@ using P2P::OutgoingTransfer; #include // Qt includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // Kopete includes #include // Just for getting the contact @@ -50,8 +50,8 @@ using P2P::OutgoingTransfer; #include -Dispatcher::Dispatcher(QObject *parent, const QString& contact, const QStringList &ip) - : QObject(parent) , m_contact(contact) , m_callbackChannel(0l) , m_ip(ip) +Dispatcher::Dispatcher(TQObject *parent, const TQString& contact, const TQStringList &ip) + : TQObject(parent) , m_contact(contact) , m_callbackChannel(0l) , m_ip(ip) {} Dispatcher::~Dispatcher() @@ -71,12 +71,12 @@ void Dispatcher::detach(TransferContext* transfer) transfer->deleteLater(); } -QString Dispatcher::localContact() +TQString Dispatcher::localContact() { return m_contact; } -void Dispatcher::requestDisplayIcon(const QString& from, const QString& msnObject) +void Dispatcher::requestDisplayIcon(const TQString& from, const TQString& msnObject) { Q_UINT32 sessionId = rand()%0xFFFFFF00 + 4; TransferContext* current = @@ -91,13 +91,13 @@ void Dispatcher::requestDisplayIcon(const QString& from, const QString& msnObjec kdDebug(14140) << k_funcinfo << "Requesting, " << msnObject << endl; - QString context = QString::fromUtf8(KCodecs::base64Encode(msnObject.utf8())); + TQString context = TQString::fromUtf8(KCodecs::base64Encode(msnObject.utf8())); // NOTE remove the \0 character automatically - // appended to a QCString. - context.replace("=", QString::null); - QString content = + // appended to a TQCString. + context.replace("=", TQString::null); + TQString content = "EUF-GUID: {A4268EEC-FEC5-49E5-95C3-F126696BDBF6}\r\n" - "SessionID: " + QString::number(sessionId) + "\r\n" + "SessionID: " + TQString::number(sessionId) + "\r\n" "AppID: 1\r\n" "Context: " + context + "\r\n" "\r\n"; @@ -105,7 +105,7 @@ void Dispatcher::requestDisplayIcon(const QString& from, const QString& msnObjec current->sendMessage(INVITE, content); } -void Dispatcher::sendFile(const QString& path, Q_INT64 fileSize, const QString& to) +void Dispatcher::sendFile(const TQString& path, Q_INT64 fileSize, const TQString& to) { // Create a new transfer context that will handle // the file transfer. @@ -119,14 +119,14 @@ void Dispatcher::sendFile(const QString& path, Q_INT64 fileSize, const QString& m_sessions.insert(sessionId, current); // Set the transfer context file. - current->m_file = new QFile(path); + current->m_file = new TQFile(path); // Create the file context data. - QString context; + TQString context; - QByteArray header(638); + TQByteArray header(638); header.fill('\0'); - QDataStream writer(header, IO_WriteOnly); - writer.setByteOrder(QDataStream::LittleEndian); + TQDataStream writer(header, IO_WriteOnly); + writer.setByteOrder(TQDataStream::LittleEndian); // Write the header length to the stream. writer << (Q_INT32)638; @@ -138,8 +138,8 @@ void Dispatcher::sendFile(const QString& path, Q_INT64 fileSize, const QString& // TODO support file preview. For now disable file preview. writer << (Q_INT32)1; // Write the file name in utf-16 to the stream. - QTextStream ts(header, IO_WriteOnly); - ts.setEncoding(QTextStream::RawUnicode); + TQTextStream ts(header, IO_WriteOnly); + ts.setEncoding(TQTextStream::RawUnicode); ts.device()->at(20); ts << path.section('/', -1); // NOTE Background Sharing base64 [540..569] @@ -151,21 +151,21 @@ void Dispatcher::sendFile(const QString& path, Q_INT64 fileSize, const QString& writer << (Q_UINT32)0xFFFFFFFF; // Encode the file context header to base64 encoding. - context = QString::fromUtf8(KCodecs::base64Encode(header)); + context = TQString::fromUtf8(KCodecs::base64Encode(header)); // Send an INVITE message to the recipient. - QString content = "EUF-GUID: {5D3E02AB-6190-11D3-BBBB-00C04F795683}\r\n" - "SessionID: " + QString::number(sessionId) + "\r\n" + TQString content = "EUF-GUID: {5D3E02AB-6190-11D3-BBBB-00C04F795683}\r\n" + "SessionID: " + TQString::number(sessionId) + "\r\n" "AppID: 2\r\n" "Context: " + context + "\r\n" "\r\n"; current->sendMessage(INVITE, content); } -void Dispatcher::sendImage(const QString& /*fileName*/, const QString& /*to*/) +void Dispatcher::sendImage(const TQString& /*fileName*/, const TQString& /*to*/) { // TODO kdDebug(14140) << k_funcinfo << endl; -// QFile imageFile(fileName); +// TQFile imageFile(fileName); // if(!imageFile.open(IO_ReadOnly)) // { // kdDebug(14140) << k_funcinfo << "Error opening image file." @@ -180,7 +180,7 @@ void Dispatcher::sendImage(const QString& /*fileName*/, const QString& /*to*/) } #if MSN_WEBCAM -void Dispatcher::startWebcam(const QString &/*myHandle*/, const QString &msgHandle, bool wantToReceive) +void Dispatcher::startWebcam(const TQString &/*myHandle*/, const TQString &msgHandle, bool wantToReceive) { Q_UINT32 sessionId = rand()%0xFFFFFF00 + 4; Webcam::Who who= wantToReceive ? Webcam::wViewer : Webcam::wProducer; @@ -195,10 +195,10 @@ void Dispatcher::startWebcam(const QString &/*myHandle*/, const QString &msgHand // {4BD96FC0-AB17-4425-A14A-439185962DC8} <- i want to show you my webcam // {1C9AA97E-9C05-4583-A3BD-908A196F1E92} <- i want to see your webcam - QString GUID= (who==Webcam::wProducer) ? "4BD96FC0-AB17-4425-A14A-439185962DC8" : "1C9AA97E-9C05-4583-A3BD-908A196F1E92" ; + TQString GUID= (who==Webcam::wProducer) ? "4BD96FC0-AB17-4425-A14A-439185962DC8" : "1C9AA97E-9C05-4583-A3BD-908A196F1E92" ; - QString content="EUF-GUID: {"+GUID+"}\r\n" - "SessionID: "+ QString::number(sessionId)+"\r\n" + TQString content="EUF-GUID: {"+GUID+"}\r\n" + "SessionID: "+ TQString::number(sessionId)+"\r\n" "AppID: 4\r\n" "Context: ewBCADgAQgBFADcAMABEAEUALQBFADIAQwBBAC0ANAA0ADAAMAAtAEEARQAwADMALQA4ADgARgBGADgANQBCADkARgA0AEUAOAB9AA==\r\n\r\n"; @@ -210,7 +210,7 @@ void Dispatcher::startWebcam(const QString &/*myHandle*/, const QString &msgHand -void Dispatcher::slotReadMessage(const QString &from, const QByteArray& stream) +void Dispatcher::slotReadMessage(const TQString &from, const TQByteArray& stream) { P2P::Message receivedMessage = m_messageFormatter.readMessage(stream); @@ -222,7 +222,7 @@ void Dispatcher::slotReadMessage(const QString &from, const QByteArray& stream) if((receivedMessage.header.dataSize == 0)/* && ((receivedMessage.header.flag & 0x02) == 0x02)*/) { TransferContext *current = 0l; - QMap::Iterator it = m_sessions.begin(); + TQMap::Iterator it = m_sessions.begin(); for(; it != m_sessions.end(); it++) { if(receivedMessage.header.ackSessionIdentifier == it.data()->m_identifier){ @@ -250,7 +250,7 @@ void Dispatcher::slotReadMessage(const QString &from, const QByteArray& stream) if(m_messageBuffer.contains(receivedMessage.header.identifier)) { kdDebug(14140) << k_funcinfo - << QString("retrieving buffered messsage, %1").arg(receivedMessage.header.identifier) + << TQString("retrieving buffered messsage, %1").arg(receivedMessage.header.identifier) << endl; // The message was split, try to reconstruct the message @@ -288,9 +288,9 @@ void Dispatcher::dispatch(const P2P::Message& message) } else { - QString body = - QCString(message.body.data(), message.header.dataSize); - QRegExp regex("SessionID: ([0-9]*)\r\n"); + TQString body = + TQCString(message.body.data(), message.header.dataSize); + TQRegExp regex("SessionID: ([0-9]*)\r\n"); if(regex.search(body) > 0) { Q_UINT32 sessionId = regex.cap(1).toUInt(); @@ -312,12 +312,12 @@ void Dispatcher::dispatch(const P2P::Message& message) { // If the message handler still has not been found, // try to retrieve the handler based on the call id. - regex = QRegExp("Call-ID: \\{([0-9A-F\\-]*)\\}\r\n"); + regex = TQRegExp("Call-ID: \\{([0-9A-F\\-]*)\\}\r\n"); regex.search(body); - QString callId = regex.cap(1); + TQString callId = regex.cap(1); TransferContext *current = 0l; - QMap::Iterator it = m_sessions.begin(); + TQMap::Iterator it = m_sessions.begin(); for(; it != m_sessions.end(); it++) { current = it.data(); @@ -347,14 +347,14 @@ void Dispatcher::dispatch(const P2P::Message& message) // The entire message has not been received; // buffer the recevied portion of the original message. kdDebug(14140) << k_funcinfo - << QString("Buffering messsage, %1").arg(message.header.identifier) + << TQString("Buffering messsage, %1").arg(message.header.identifier) << endl; m_messageBuffer.insert(message.header.identifier, message); return; } - QString body = - QCString(message.body.data(), message.header.dataSize); + TQString body = + TQCString(message.body.data(), message.header.dataSize); kdDebug(14140) << k_funcinfo << "received, " << body << endl; if(body.startsWith("INVITE")) @@ -362,23 +362,23 @@ void Dispatcher::dispatch(const P2P::Message& message) // Retrieve the branch, call id, and session id. // These fields will be used later on in the p2p // transaction. - QRegExp regex(";branch=\\{([0-9A-F\\-]*)\\}\r\n"); + TQRegExp regex(";branch=\\{([0-9A-F\\-]*)\\}\r\n"); regex.search(body); - QString branch = regex.cap(1); - regex = QRegExp("Call-ID: \\{([0-9A-F\\-]*)\\}\r\n"); + TQString branch = regex.cap(1); + regex = TQRegExp("Call-ID: \\{([0-9A-F\\-]*)\\}\r\n"); regex.search(body); - QString callId = regex.cap(1); - regex = QRegExp("SessionID: ([0-9]*)\r\n"); + TQString callId = regex.cap(1); + regex = TQRegExp("SessionID: ([0-9]*)\r\n"); regex.search(body); - QString sessionId = regex.cap(1); + TQString sessionId = regex.cap(1); // Retrieve the contact that requested the session. - regex = QRegExp("From: ]*)>"); + regex = TQRegExp("From: ]*)>"); regex.search(body); - QString from = regex.cap(1); + TQString from = regex.cap(1); // Retrieve the application identifier which // is used to determine what type of session // is being requested. - regex = QRegExp("AppID: ([0-9]*)\r\n"); + regex = TQRegExp("AppID: ([0-9]*)\r\n"); regex.search(body); Q_UINT32 applicationId = regex.cap(1).toUInt(); @@ -387,9 +387,9 @@ void Dispatcher::dispatch(const P2P::Message& message) // A contact has requested a session to download // a display icon (User Display Icon or CustomEmotion). - regex = QRegExp("Context: ([0-9a-zA-Z+/=]*)"); + regex = TQRegExp("Context: ([0-9a-zA-Z+/=]*)"); regex.search(body); - QCString msnobj; + TQCString msnobj; // Decode the msn object from base64 encoding. KCodecs::base64Decode(regex.cap(1).utf8() , msnobj); @@ -407,10 +407,10 @@ void Dispatcher::dispatch(const P2P::Message& message) m_sessions.insert(sessionId.toUInt(), current); // Determine the display icon being requested. - QString fileName = objectList.contains(msnobj) + TQString fileName = objectList.contains(msnobj) ? objectList[msnobj] : m_pictureUrl; - QFile *source = new QFile(fileName); + TQFile *source = new TQFile(fileName); // Try to open the source file for reading. // If an error occurs, send an internal // error message to the recipient. @@ -427,7 +427,7 @@ void Dispatcher::dispatch(const P2P::Message& message) current->m_ackSessionIdentifier = message.header.identifier; current->m_ackUniqueIdentifier = message.header.ackSessionIdentifier; // Send a 200 OK message to the recipient. - QString content = QString("SessionID: %1\r\n\r\n").arg(sessionId); + TQString content = TQString("SessionID: %1\r\n\r\n").arg(sessionId); current->sendMessage(OK, content); } else if(applicationId == 2) @@ -447,14 +447,14 @@ void Dispatcher::dispatch(const P2P::Message& message) // Add the transfer to the list. m_sessions.insert(sessionId.toUInt(), transfer); - regex = QRegExp("Context: ([0-9a-zA-Z+/=]*)"); + regex = TQRegExp("Context: ([0-9a-zA-Z+/=]*)"); regex.search(body); - QByteArray context; + TQByteArray context; // Decode the file context from base64 encoding. KCodecs::base64Decode(regex.cap(1).utf8(), context); - QDataStream reader(context, IO_ReadOnly); - reader.setByteOrder(QDataStream::LittleEndian); + TQDataStream reader(context, IO_ReadOnly); + reader.setByteOrder(TQDataStream::LittleEndian); //Retrieve the file info from the context field. // File Size [8..15] Int64 reader.device()->at(8); @@ -468,17 +468,17 @@ void Dispatcher::dispatch(const P2P::Message& message) reader >> flag; kdDebug(14140) << flag << endl; // FileName UTF16 (Unicode) [19..539] - QByteArray bytes(520); + TQByteArray bytes(520); reader.readRawBytes(bytes.data(), bytes.size()); - QTextStream ts(bytes, IO_ReadOnly); - ts.setEncoding(QTextStream::Unicode); - QString fileName; + TQTextStream ts(bytes, IO_ReadOnly); + ts.setEncoding(TQTextStream::Unicode); + TQString fileName; fileName = ts.readLine().utf8(); emit incomingTransfer(from, fileName, fileSize); kdDebug(14140) << - QString("%1, %2 bytes.").arg(fileName, QString::number(fileSize)) + TQString("%1, %2 bytes.").arg(fileName, TQString::number(fileSize)) << endl << endl; @@ -493,11 +493,11 @@ void Dispatcher::dispatch(const P2P::Message& message) transfer->m_ackSessionIdentifier = message.header.identifier; transfer->m_ackUniqueIdentifier = message.header.ackSessionIdentifier; - QObject::connect(Kopete::TransferManager::transferManager(), SIGNAL(accepted(Kopete::Transfer*, const QString&)), transfer, SLOT(slotTransferAccepted(Kopete::Transfer*, const QString&))); - QObject::connect(Kopete::TransferManager::transferManager(), SIGNAL(refused(const Kopete::FileTransferInfo&)), transfer, SLOT(slotTransferRefused(const Kopete::FileTransferInfo&))); + TQObject::connect(Kopete::TransferManager::transferManager(), TQT_SIGNAL(accepted(Kopete::Transfer*, const TQString&)), transfer, TQT_SLOT(slotTransferAccepted(Kopete::Transfer*, const TQString&))); + TQObject::connect(Kopete::TransferManager::transferManager(), TQT_SIGNAL(refused(const Kopete::FileTransferInfo&)), transfer, TQT_SLOT(slotTransferRefused(const Kopete::FileTransferInfo&))); // Show the file transfer accept/decline dialog. - Kopete::TransferManager::transferManager()->askIncomingTransfer(contact, fileName, fileSize, QString::null, sessionId); + Kopete::TransferManager::transferManager()->askIncomingTransfer(contact, fileName, fileSize, TQString::null, sessionId); } else { @@ -512,9 +512,9 @@ void Dispatcher::dispatch(const P2P::Message& message) else if(applicationId == 4) { #if MSN_WEBCAM - regex = QRegExp("EUF-GUID: \\{([0-9a-zA-Z\\-]*)\\}"); + regex = TQRegExp("EUF-GUID: \\{([0-9a-zA-Z\\-]*)\\}"); regex.search(body); - QString GUID=regex.cap(1); + TQString GUID=regex.cap(1); kdDebug(14140) << k_funcinfo << "webcam " << GUID << endl; @@ -542,7 +542,7 @@ void Dispatcher::dispatch(const P2P::Message& message) m_sessions.insert(sessionId.toUInt(), current); // Acknowledge the session request. current->acknowledge(message); - QTimer::singleShot(0,current, SLOT(askIncommingInvitation()) ); + TQTimer::singleShot(0,current, TQT_SLOT(askIncommingInvitation()) ); #endif } } @@ -550,26 +550,26 @@ void Dispatcher::dispatch(const P2P::Message& message) { // A contact has sent an inkformat (handwriting) gif. // NOTE The entire message body is UTF16 encoded. - QString body = ""; + TQString body = ""; for (Q_UINT32 i=0; i < message.header.totalDataSize; i++){ - if (message.body[i] != QChar('\0')){ - body += QChar(message.body[i]); + if (message.body[i] != TQChar('\0')){ + body += TQChar(message.body[i]); } } - QRegExp regex("Content-Type: ([A-Za-z0-9$!*/\\-]*)"); + TQRegExp regex("Content-Type: ([A-Za-z0-9$!*/\\-]*)"); regex.search(body); - QString contentType = regex.cap(1); + TQString contentType = regex.cap(1); if(contentType == "image/gif") { IncomingTransfer transfer(message.source, this, message.header.sessionId); transfer.acknowledge(message); - regex = QRegExp("base64:([0-9a-zA-Z+/=]*)"); + regex = TQRegExp("base64:([0-9a-zA-Z+/=]*)"); regex.search(body); - QString base64 = regex.cap(1); - QByteArray image; + TQString base64 = regex.cap(1); + TQByteArray image; // Convert from base64 encoding to byte array. KCodecs::base64Decode(base64.utf8(), image); // Create a temporary file to store the image data. @@ -590,7 +590,7 @@ void Dispatcher::messageAcknowledged(unsigned int correlationId, bool fullReceiv if(fullReceive) { TransferContext *current = 0l; - QMap::Iterator it = m_sessions.begin(); + TQMap::Iterator it = m_sessions.begin(); for(; it != m_sessions.end(); it++) { current = it.data(); @@ -604,7 +604,7 @@ void Dispatcher::messageAcknowledged(unsigned int correlationId, bool fullReceiv } } -Kopete::Contact* Dispatcher::getContactByAccountId(const QString& accountId) +Kopete::Contact* Dispatcher::getContactByAccountId(const TQString& accountId) { Kopete::Contact *contact = 0l; if(parent()) @@ -628,7 +628,7 @@ Dispatcher::CallbackChannel::CallbackChannel(MSNSwitchBoardSocket *switchboard) Dispatcher::CallbackChannel::~CallbackChannel() {} -Q_UINT32 Dispatcher::CallbackChannel::send(const QByteArray& stream) +Q_UINT32 Dispatcher::CallbackChannel::send(const TQByteArray& stream) { return m_switchboard->sendCommand("MSG", "D", true, stream, true); } diff --git a/kopete/protocols/msn/dispatcher.h b/kopete/protocols/msn/dispatcher.h index 56bd1856..72a9cc12 100644 --- a/kopete/protocols/msn/dispatcher.h +++ b/kopete/protocols/msn/dispatcher.h @@ -17,8 +17,8 @@ #ifndef DISPATCHER_H #define DISPATCHER_H -#include -#include +#include +#include #include "kopete_export.h" @@ -41,30 +41,30 @@ namespace P2P{ class KOPETE_EXPORT Dispatcher : public QObject { Q_OBJECT public: - Dispatcher(QObject *parent, const QString& contact, const QStringList &ip); + Dispatcher(TQObject *parent, const TQString& contact, const TQStringList &ip); ~Dispatcher(); void detach(TransferContext* transfer); - QString localContact(); - void requestDisplayIcon(const QString& from, const QString& msnObject); - void sendFile(const QString& path, Q_INT64 fileSize, const QString& to); - void sendImage(const QString& fileName, const QString& to); - QString m_pictureUrl; - QMap objectList; + TQString localContact(); + void requestDisplayIcon(const TQString& from, const TQString& msnObject); + void sendFile(const TQString& path, Q_INT64 fileSize, const TQString& to); + void sendImage(const TQString& fileName, const TQString& to); + TQString m_pictureUrl; + TQMap objectList; #if MSN_WEBCAM - void startWebcam(const QString &myHandle, const QString &msgHandle, bool wantToReceive); + void startWebcam(const TQString &myHandle, const TQString &msgHandle, bool wantToReceive); #endif public slots: - void slotReadMessage(const QString &from, const QByteArray& stream); + void slotReadMessage(const TQString &from, const TQByteArray& stream); void messageAcknowledged(unsigned int correlationId, bool fullReceive); signals: - void sendCommand(const QString &cmd, const QString &args = QString::null, bool addId = true, const QByteArray &body = QByteArray(), bool binary=false); - void displayIconReceived(KTempFile* file, const QString& msnObject); - void incomingTransfer(const QString& from, const QString& fileName, Q_INT64 fileSize); + void sendCommand(const TQString &cmd, const TQString &args = TQString::null, bool addId = true, const TQByteArray &body = TQByteArray(), bool binary=false); + void displayIconReceived(KTempFile* file, const TQString& msnObject); + void incomingTransfer(const TQString& from, const TQString& fileName, Q_INT64 fileSize); private: class CallbackChannel @@ -73,7 +73,7 @@ namespace P2P{ CallbackChannel(MSNSwitchBoardSocket *switchboard); ~CallbackChannel(); - Q_UINT32 send(const QByteArray& stream); + Q_UINT32 send(const TQByteArray& stream); private: MSNSwitchBoardSocket *m_switchboard; @@ -84,19 +84,19 @@ namespace P2P{ /** * IP's of this compiter, the first one is the one seen by the server. */ - QStringList localIp() { return m_ip; } + TQStringList localIp() { return m_ip; } private: void dispatch(const P2P::Message& message); - Kopete::Contact* getContactByAccountId(const QString& accountId); + Kopete::Contact* getContactByAccountId(const TQString& accountId); P2P::MessageFormatter m_messageFormatter; - QMap m_sessions; - QMap m_messageBuffer; - QString m_contact; + TQMap m_sessions; + TQMap m_messageBuffer; + TQString m_contact; CallbackChannel *m_callbackChannel; - QStringList m_ip; + TQStringList m_ip; friend class P2P::TransferContext; friend class P2P::IncomingTransfer; diff --git a/kopete/protocols/msn/incomingtransfer.cpp b/kopete/protocols/msn/incomingtransfer.cpp index aefbdbfe..c7757219 100644 --- a/kopete/protocols/msn/incomingtransfer.cpp +++ b/kopete/protocols/msn/incomingtransfer.cpp @@ -29,13 +29,13 @@ using P2P::Message; using namespace KNetwork; // Qt includes -#include -#include +#include +#include // Kopete includes #include -IncomingTransfer::IncomingTransfer(const QString& from, P2P::Dispatcher *dispatcher, Q_UINT32 sessionId) +IncomingTransfer::IncomingTransfer(const TQString& from, P2P::Dispatcher *dispatcher, Q_UINT32 sessionId) : TransferContext(from,dispatcher,sessionId) { m_direction = P2P::Incoming; @@ -59,19 +59,19 @@ IncomingTransfer::~IncomingTransfer() } -void IncomingTransfer::slotTransferAccepted(Kopete::Transfer* transfer, const QString& /*fileName*/) +void IncomingTransfer::slotTransferAccepted(Kopete::Transfer* transfer, const TQString& /*fileName*/) { Q_UINT32 sessionId = transfer->info().internalId().toUInt(); if(sessionId!=m_sessionId) return; - QObject::connect(transfer , SIGNAL(transferCanceled()), this, SLOT(abort())); + TQObject::connect(transfer , TQT_SIGNAL(transferCanceled()), this, TQT_SLOT(abort())); m_transfer = transfer; - QString content = QString("SessionID: %1\r\n\r\n").arg(sessionId); + TQString content = TQString("SessionID: %1\r\n\r\n").arg(sessionId); sendMessage(OK, content); - QObject::disconnect(Kopete::TransferManager::transferManager(), 0l, this, 0l); + TQObject::disconnect(Kopete::TransferManager::transferManager(), 0l, this, 0l); } void IncomingTransfer::slotTransferRefused(const Kopete::FileTransferInfo& info) @@ -80,12 +80,12 @@ void IncomingTransfer::slotTransferRefused(const Kopete::FileTransferInfo& info) if(sessionId!=m_sessionId) return; - QString content = QString("SessionID: %1\r\n\r\n").arg(sessionId); + TQString content = TQString("SessionID: %1\r\n\r\n").arg(sessionId); // Send the sending client a cancelation message. sendMessage(DECLINE, content); m_state=Finished; - QObject::disconnect(Kopete::TransferManager::transferManager(), 0l, this, 0l); + TQObject::disconnect(Kopete::TransferManager::transferManager(), 0l, this, 0l); } @@ -106,7 +106,7 @@ void IncomingTransfer::acknowledged() // should follow. Otherwise, the file transfer may start right away. if(m_transfer) { - QFile *destination = new QFile(m_transfer->destinationURL().path()); + TQFile *destination = new TQFile(m_transfer->destinationURL().path()); if(!destination->open(IO_WriteOnly)) { m_transfer->slotError(KIO::ERR_CANNOT_OPEN_FOR_WRITING, i18n("Cannot open file for writing")); @@ -141,7 +141,7 @@ void IncomingTransfer::processMessage(const Message& message) { // UserDisplayIcon data or File data is in this message. // Write the recieved data to the file. - kdDebug(14140) << k_funcinfo << QString("Received, %1 bytes").arg(message.header.dataSize) << endl; + kdDebug(14140) << k_funcinfo << TQString("Received, %1 bytes").arg(message.header.dataSize) << endl; m_file->writeBlock(message.body.data(), message.header.dataSize); if(m_transfer){ @@ -178,7 +178,7 @@ void IncomingTransfer::processMessage(const Message& message) { // Data preparation message. //if (m_tempFile->name().isEmpty() == false) { - // QFile::remove(m_tempFile->name()); + // TQFile::remove(m_tempFile->name()); //} m_tempFile = new KTempFile(locateLocal("tmp", "msnpicture--"), ".png"); m_tempFile->setAutoDelete(true); @@ -189,30 +189,30 @@ void IncomingTransfer::processMessage(const Message& message) } else { - QString body = - QCString(message.body.data(), message.header.dataSize); + TQString body = + TQCString(message.body.data(), message.header.dataSize); // kdDebug(14140) << k_funcinfo << "received, " << body << endl; if(body.startsWith("INVITE")) { // Retrieve some MSNSLP headers used when // replying to this INVITE message. - QRegExp regex(";branch=\\{([0-9A-F\\-]*)\\}\r\n"); + TQRegExp regex(";branch=\\{([0-9A-F\\-]*)\\}\r\n"); regex.search(body); m_branch = regex.cap(1); // NOTE Call-ID never changes. - regex = QRegExp("Call-ID: \\{([0-9A-F\\-]*)\\}\r\n"); + regex = TQRegExp("Call-ID: \\{([0-9A-F\\-]*)\\}\r\n"); regex.search(body); m_callId = regex.cap(1); - regex = QRegExp("Bridges: ([^\r\n]*)\r\n"); + regex = TQRegExp("Bridges: ([^\r\n]*)\r\n"); regex.search(body); - QString bridges = regex.cap(1); + TQString bridges = regex.cap(1); // The NetID field is 0 if the Conn-Type is // Direct-Connect or Firewall, otherwise, it is // a randomly generated number. - regex = QRegExp("NetID: (\\-?\\d+)\r\n"); + regex = TQRegExp("NetID: (\\-?\\d+)\r\n"); regex.search(body); - QString netId = regex.cap(1); + TQString netId = regex.cap(1); kdDebug(14140) << "net id, " << netId << endl; // Connection Types // - Direct-Connect @@ -220,9 +220,9 @@ void IncomingTransfer::processMessage(const Message& message) // - IP-Restrict-NAT // - Symmetric-NAT // - Firewall - regex = QRegExp("Conn-Type: ([^\r\n]+)\r\n"); + regex = TQRegExp("Conn-Type: ([^\r\n]+)\r\n"); regex.search(body); - QString connType = regex.cap(1); + TQString connType = regex.cap(1); bool wouldListen = false; if(netId.toUInt() == 0 && connType == "Direct-Connect"){ @@ -235,7 +235,7 @@ void IncomingTransfer::processMessage(const Message& message) #if 1 wouldListen = false; // TODO Direct connection support #endif - QString content; + TQString content; if(wouldListen) { @@ -243,8 +243,8 @@ void IncomingTransfer::processMessage(const Message& message) m_listener = new KServerSocket("", ""); m_listener->setResolutionEnabled(true); // Create the callback that will try to accept incoming connections. - QObject::connect(m_listener, SIGNAL(readyAccept()), SLOT(slotAccept())); - QObject::connect(m_listener, SIGNAL(gotError(int)), this, SLOT(slotListenError(int))); + TQObject::connect(m_listener, TQT_SIGNAL(readyAccept()), TQT_SLOT(slotAccept())); + TQObject::connect(m_listener, TQT_SIGNAL(gotError(int)), this, TQT_SLOT(slotListenError(int))); // Listen for incoming connections. bool isListening = m_listener->listen(1); kdDebug(14140) << k_funcinfo << (isListening ? "listening" : "not listening") << endl; @@ -254,9 +254,9 @@ void IncomingTransfer::processMessage(const Message& message) content = "Bridge: TCPv1\r\n" "Listening: true\r\n" + - QString("Hashed-Nonce: {%1}\r\n").arg(P2P::Uid::createUid()) + - QString("IPv4Internal-Addrs: %1\r\n").arg(m_listener->localAddress().nodeName()) + - QString("IPv4Internal-Port: %1\r\n").arg(m_listener->localAddress().serviceName()) + + TQString("Hashed-Nonce: {%1}\r\n").arg(P2P::Uid::createUid()) + + TQString("IPv4Internal-Addrs: %1\r\n").arg(m_listener->localAddress().nodeName()) + + TQString("IPv4Internal-Port: %1\r\n").arg(m_listener->localAddress().serviceName()) + "\r\n"; } else @@ -349,11 +349,11 @@ void IncomingTransfer::slotAccept() m_socket->enableWrite(false); // Create the callback that will try to read bytes from the accepted socket. - QObject::connect(m_socket, SIGNAL(readyRead()), this, SLOT(slotSocketRead())); + TQObject::connect(m_socket, TQT_SIGNAL(readyRead()), this, TQT_SLOT(slotSocketRead())); // Create the callback that will try to handle the socket close event. - QObject::connect(m_socket, SIGNAL(closed()), this, SLOT(slotSocketClosed())); + TQObject::connect(m_socket, TQT_SIGNAL(closed()), this, TQT_SLOT(slotSocketClosed())); // Create the callback that will try to handle the socket error event. - QObject::connect(m_socket, SIGNAL(gotError(int)), this, SLOT(slotSocketError(int))); + TQObject::connect(m_socket, TQT_SIGNAL(gotError(int)), this, TQT_SLOT(slotSocketError(int))); } void IncomingTransfer::slotSocketRead() @@ -362,10 +362,10 @@ void IncomingTransfer::slotSocketRead() kdDebug(14140) << k_funcinfo << available << ", bytes available." << endl; if(available > 0) { - QByteArray buffer(available); + TQByteArray buffer(available); m_socket->readBlock(buffer.data(), buffer.size()); - if(QString(buffer) == "foo"){ + if(TQString(buffer) == "foo"){ kdDebug(14140) << "Connection Check." << endl; } } diff --git a/kopete/protocols/msn/incomingtransfer.h b/kopete/protocols/msn/incomingtransfer.h index 23e101b3..ca879deb 100644 --- a/kopete/protocols/msn/incomingtransfer.h +++ b/kopete/protocols/msn/incomingtransfer.h @@ -31,7 +31,7 @@ namespace P2P{ class IncomingTransfer : public P2P::TransferContext { Q_OBJECT public: - IncomingTransfer(const QString& from, P2P::Dispatcher *dispatcher, Q_UINT32 sessionId); + IncomingTransfer(const TQString& from, P2P::Dispatcher *dispatcher, Q_UINT32 sessionId); virtual ~IncomingTransfer(); private slots: @@ -41,7 +41,7 @@ namespace P2P{ void slotSocketClosed(); void slotSocketError(int errorCode); - void slotTransferAccepted(Kopete::Transfer* transfer, const QString& fileName); + void slotTransferAccepted(Kopete::Transfer* transfer, const TQString& fileName); void slotTransferRefused(const Kopete::FileTransferInfo& info); 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 -#include +#include +#include // Kde includes #include @@ -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; diff --git a/kopete/protocols/msn/messageformatter.h b/kopete/protocols/msn/messageformatter.h index 9eae8682..f86d679d 100644 --- a/kopete/protocols/msn/messageformatter.h +++ b/kopete/protocols/msn/messageformatter.h @@ -16,7 +16,7 @@ #ifndef MESSAGEFORMATTER_H #define MESSAGEFORMATTER_H -#include +#include namespace P2P{ class Message; @@ -29,11 +29,11 @@ namespace P2P{ class MessageFormatter : public QObject { Q_OBJECT public: - MessageFormatter(QObject *parent = 0, const char *name = 0); + MessageFormatter(TQObject *parent = 0, const char *name = 0); ~MessageFormatter(); - Message readMessage(const QByteArray& stream, bool compact=false); - void writeMessage(const Message& message, QByteArray& stream, bool compact=false); + Message readMessage(const TQByteArray& stream, bool compact=false); + void writeMessage(const Message& message, TQByteArray& stream, bool compact=false); }; } diff --git a/kopete/protocols/msn/msnaccount.cpp b/kopete/protocols/msn/msnaccount.cpp index 01caec11..267cd0d7 100644 --- a/kopete/protocols/msn/msnaccount.cpp +++ b/kopete/protocols/msn/msnaccount.cpp @@ -31,10 +31,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "msncontact.h" #include "msnnotifysocket.h" @@ -61,7 +61,7 @@ #include "avdevice/videodevicepool.h" #endif -MSNAccount::MSNAccount( MSNProtocol *parent, const QString& AccountID, const char *name ) +MSNAccount::MSNAccount( MSNProtocol *parent, const TQString& AccountID, const char *name ) : Kopete::PasswordedAccount ( parent, AccountID.lower(), 0, name ) { m_notifySocket = 0L; @@ -73,16 +73,16 @@ MSNAccount::MSNAccount( MSNProtocol *parent, const QString& AccountID, const cha setMyself( new MSNContact( this, accountId(), Kopete::ContactList::self()->myself() ) ); //myself()->setOnlineStatus( MSNProtocol::protocol()->FLN ); - QObject::connect( Kopete::ContactList::self(), SIGNAL( groupRenamed( Kopete::Group *, const QString & ) ), - SLOT( slotKopeteGroupRenamed( Kopete::Group * ) ) ); - QObject::connect( Kopete::ContactList::self(), SIGNAL( groupRemoved( Kopete::Group * ) ), - SLOT( slotKopeteGroupRemoved( Kopete::Group * ) ) ); + TQObject::connect( Kopete::ContactList::self(), TQT_SIGNAL( groupRenamed( Kopete::Group *, const TQString & ) ), + TQT_SLOT( slotKopeteGroupRenamed( Kopete::Group * ) ) ); + TQObject::connect( Kopete::ContactList::self(), TQT_SIGNAL( groupRemoved( Kopete::Group * ) ), + TQT_SLOT( slotKopeteGroupRemoved( Kopete::Group * ) ) ); - QObject::connect( Kopete::ContactList::self(), SIGNAL( globalIdentityChanged(const QString&, const QVariant& ) ), SLOT( slotGlobalIdentityChanged(const QString&, const QVariant& ) )); + TQObject::connect( Kopete::ContactList::self(), TQT_SIGNAL( globalIdentityChanged(const TQString&, const TQVariant& ) ), TQT_SLOT( slotGlobalIdentityChanged(const TQString&, const TQVariant& ) )); - m_openInboxAction = new KAction( i18n( "Open Inbo&x..." ), "mail_generic", 0, this, SLOT( slotOpenInbox() ), this, "m_openInboxAction" ); - m_changeDNAction = new KAction( i18n( "&Change Display Name..." ), QString::null, 0, this, SLOT( slotChangePublicName() ), this, "renameAction" ); - m_startChatAction = new KAction( i18n( "&Start Chat..." ), "mail_generic", 0, this, SLOT( slotStartChat() ), this, "startChatAction" ); + m_openInboxAction = new KAction( i18n( "Open Inbo&x..." ), "mail_generic", 0, this, TQT_SLOT( slotOpenInbox() ), this, "m_openInboxAction" ); + m_changeDNAction = new KAction( i18n( "&Change Display Name..." ), TQString::null, 0, this, TQT_SLOT( slotChangePublicName() ), this, "renameAction" ); + m_startChatAction = new KAction( i18n( "&Start Chat..." ), "mail_generic", 0, this, TQT_SLOT( slotStartChat() ), this, "startChatAction" ); KConfigGroup *config=configGroup(); @@ -92,7 +92,7 @@ MSNAccount::MSNAccount( MSNProtocol *parent, const QString& AccountID, const cha m_reverseList = config->readListEntry( "reverseList" ) ; // Load the avatar - m_pictureFilename = locateLocal( "appdata", "msnpicture-"+ accountId().lower().replace(QRegExp("[./~]"),"-") +".png" ); + m_pictureFilename = locateLocal( "appdata", "msnpicture-"+ accountId().lower().replace(TQRegExp("[./~]"),"-") +".png" ); resetPictureObject(true); static_cast( myself() )->setInfo( "PHH", config->readEntry("PHH") ); @@ -103,10 +103,10 @@ MSNAccount::MSNAccount( MSNProtocol *parent, const QString& AccountID, const cha //construct the group list //Before 2003-11-14 the MSN server allowed us to download the group list without downloading the whole contactlist, but it's not possible anymore - QPtrList groupList = Kopete::ContactList::self()->groups(); + TQPtrList groupList = Kopete::ContactList::self()->groups(); for ( Kopete::Group *g = groupList.first(); g; g = groupList.next() ) { - QString groupGuid=g->pluginData( protocol(), accountId() + " id" ); + TQString groupGuid=g->pluginData( protocol(), accountId() + " id" ); if ( !groupGuid.isEmpty() ) m_groupList.insert( groupGuid , g ); } @@ -124,7 +124,7 @@ MSNAccount::MSNAccount( MSNProtocol *parent, const QString& AccountID, const cha } -QString MSNAccount::serverName() +TQString MSNAccount::serverName() { return configGroup()->readEntry( "serverName" , "messenger.hotmail.com" ); } @@ -139,12 +139,12 @@ bool MSNAccount::useHttpMethod() const return configGroup()->readBoolEntry( "useHttpMethod" , false ); } -QString MSNAccount::myselfClientId() const +TQString MSNAccount::myselfClientId() const { - return QString::number(m_clientId, 10); + return TQString::number(m_clientId, 10); } -void MSNAccount::connectWithPassword( const QString &passwd ) +void MSNAccount::connectWithPassword( const TQString &passwd ) { m_newContactList=false; if ( isConnected() ) @@ -181,13 +181,13 @@ void MSNAccount::connectWithPassword( const QString &passwd ) createNotificationServer(serverName(), serverPort()); } -void MSNAccount::createNotificationServer( const QString &host, uint port ) +void MSNAccount::createNotificationServer( const TQString &host, uint port ) { if(m_notifySocket) //we are switching from one to another notifysocket. { //remove every slots to that socket, so we won't delete receive signals // from the old socket thinking they are from the new one - QObject::disconnect( m_notifySocket , 0, this, 0 ); + TQObject::disconnect( m_notifySocket , 0, this, 0 ); m_notifySocket->deleteLater(); //be sure it will be deleted m_notifySocket=0L; } @@ -200,36 +200,36 @@ void MSNAccount::createNotificationServer( const QString &host, uint port ) m_notifySocket = new MSNNotifySocket( this, accountId() , m_password); m_notifySocket->setUseHttpMethod( useHttpMethod() ); - QObject::connect( m_notifySocket, SIGNAL( groupAdded( const QString&, const QString& ) ), - SLOT( slotGroupAdded( const QString&, const QString& ) ) ); - QObject::connect( m_notifySocket, SIGNAL( groupRenamed( const QString&, const QString& ) ), - SLOT( slotGroupRenamed( const QString&, const QString& ) ) ); - QObject::connect( m_notifySocket, SIGNAL( groupListed( const QString&, const QString& ) ), - SLOT( slotGroupAdded( const QString&, const QString& ) ) ); - QObject::connect( m_notifySocket, SIGNAL( groupRemoved( const QString& ) ), - SLOT( slotGroupRemoved( const QString& ) ) ); - QObject::connect( m_notifySocket, SIGNAL( contactList(const QString&, const QString&, const QString&, uint, const QString& ) ), - SLOT( slotContactListed(const QString&, const QString&, const QString&, uint, const QString& ) ) ); - QObject::connect( m_notifySocket, SIGNAL(contactAdded(const QString&, const QString&, const QString&, const QString&, const QString& ) ), - SLOT( slotContactAdded(const QString&, const QString&, const QString&, const QString&, const QString& ) ) ); - QObject::connect( m_notifySocket, SIGNAL( contactRemoved(const QString&, const QString&, const QString&, const QString& ) ), - SLOT( slotContactRemoved(const QString&, const QString&, const QString&, const QString& ) ) ); - QObject::connect( m_notifySocket, SIGNAL( statusChanged( const Kopete::OnlineStatus & ) ), - SLOT( slotStatusChanged( const Kopete::OnlineStatus & ) ) ); - QObject::connect( m_notifySocket, SIGNAL( invitedToChat( const QString&, const QString&, const QString&, const QString&, const QString& ) ), - SLOT( slotCreateChat( const QString&, const QString&, const QString&, const QString&, const QString& ) ) ); - QObject::connect( m_notifySocket, SIGNAL( startChat( const QString&, const QString& ) ), - SLOT( slotCreateChat( const QString&, const QString& ) ) ); - QObject::connect( m_notifySocket, SIGNAL( socketClosed() ), - SLOT( slotNotifySocketClosed() ) ); - QObject::connect( m_notifySocket, SIGNAL( newContactList() ), - SLOT( slotNewContactList() ) ); - QObject::connect( m_notifySocket, SIGNAL( receivedNotificationServer(const QString&, uint ) ), - SLOT(createNotificationServer(const QString&, uint ) ) ); - QObject::connect( m_notifySocket, SIGNAL( hotmailSeted( bool ) ), - m_openInboxAction, SLOT( setEnabled( bool ) ) ); - QObject::connect( m_notifySocket, SIGNAL( errorMessage(int, const QString& ) ), - SLOT( slotErrorMessageReceived(int, const QString& ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( groupAdded( const TQString&, const TQString& ) ), + TQT_SLOT( slotGroupAdded( const TQString&, const TQString& ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( groupRenamed( const TQString&, const TQString& ) ), + TQT_SLOT( slotGroupRenamed( const TQString&, const TQString& ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( groupListed( const TQString&, const TQString& ) ), + TQT_SLOT( slotGroupAdded( const TQString&, const TQString& ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( groupRemoved( const TQString& ) ), + TQT_SLOT( slotGroupRemoved( const TQString& ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( contactList(const TQString&, const TQString&, const TQString&, uint, const TQString& ) ), + TQT_SLOT( slotContactListed(const TQString&, const TQString&, const TQString&, uint, const TQString& ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL(contactAdded(const TQString&, const TQString&, const TQString&, const TQString&, const TQString& ) ), + TQT_SLOT( slotContactAdded(const TQString&, const TQString&, const TQString&, const TQString&, const TQString& ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( contactRemoved(const TQString&, const TQString&, const TQString&, const TQString& ) ), + TQT_SLOT( slotContactRemoved(const TQString&, const TQString&, const TQString&, const TQString& ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( statusChanged( const Kopete::OnlineStatus & ) ), + TQT_SLOT( slotStatusChanged( const Kopete::OnlineStatus & ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( invitedToChat( const TQString&, const TQString&, const TQString&, const TQString&, const TQString& ) ), + TQT_SLOT( slotCreateChat( const TQString&, const TQString&, const TQString&, const TQString&, const TQString& ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( startChat( const TQString&, const TQString& ) ), + TQT_SLOT( slotCreateChat( const TQString&, const TQString& ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( socketClosed() ), + TQT_SLOT( slotNotifySocketClosed() ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( newContactList() ), + TQT_SLOT( slotNewContactList() ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( receivedNotificationServer(const TQString&, uint ) ), + TQT_SLOT(createNotificationServer(const TQString&, uint ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( hotmailSeted( bool ) ), + m_openInboxAction, TQT_SLOT( setEnabled( bool ) ) ); + TQObject::connect( m_notifySocket, TQT_SIGNAL( errorMessage(int, const TQString& ) ), + TQT_SLOT( slotErrorMessageReceived(int, const TQString& ) ) ); m_notifySocket->setStatus( m_connectstatus ); m_notifySocket->connect(host, port); @@ -269,7 +269,7 @@ KActionMenu * MSNAccount::actionMenu() #if !defined NDEBUG KActionMenu *debugMenu = new KActionMenu( "Debug", m_actionMenu ); debugMenu->insert( new KAction( i18n( "Send Raw C&ommand..." ), 0, - this, SLOT( slotDebugRawCommand() ), debugMenu, "m_debugRawCommand" ) ); + this, TQT_SLOT( slotDebugRawCommand() ), debugMenu, "m_debugRawCommand" ) ); m_actionMenu->popupMenu()->insertSeparator(); m_actionMenu->insert( debugMenu ); #endif @@ -283,7 +283,7 @@ MSNNotifySocket *MSNAccount::notifySocket() } -void MSNAccount::setOnlineStatus( const Kopete::OnlineStatus &status , const QString &reason) +void MSNAccount::setOnlineStatus( const Kopete::OnlineStatus &status , const TQString &reason) { kdDebug( 14140 ) << k_funcinfo << status.description() << endl; @@ -298,7 +298,7 @@ void MSNAccount::setOnlineStatus( const Kopete::OnlineStatus &status , const QSt // since it's the same. if( reason.contains("[Music]") ) { - QString personalMessage = reason.section("[Music]", 1); + TQString personalMessage = reason.section("[Music]", 1); setPersonalMessage( MSNProtocol::PersonalMessageMusic, personalMessage ); // Don't send un-needed status change. @@ -329,8 +329,8 @@ void MSNAccount::slotStartChat() { bool ok; - QString handle = KInputDialog::getText( i18n( "Start Chat - MSN Plugin" ), - i18n( "Please enter the email address of the person with whom you want to chat:" ), QString::null, &ok ).lower(); + TQString handle = KInputDialog::getText( i18n( "Start Chat - MSN Plugin" ), + i18n( "Please enter the email address of the person with whom you want to chat:" ), TQString::null, &ok ).lower(); if ( ok ) { if ( MSNProtocol::validContactId( handle ) ) @@ -356,7 +356,7 @@ void MSNAccount::slotDebugRawCommand() MSNDebugRawCmdDlg *dlg = new MSNDebugRawCmdDlg( 0L ); int result = dlg->exec(); - if ( result == QDialog::Accepted && m_notifySocket ) + if ( result == TQDialog::Accepted && m_notifySocket ) { m_notifySocket->sendCommand( dlg->command(), dlg->params(), dlg->addId(), dlg->msg().replace( "\n", "\r\n" ).utf8() ); @@ -374,7 +374,7 @@ void MSNAccount::slotChangePublicName() } bool ok; - QString name = KInputDialog::getText( i18n( "Change Display Name - MSN Plugin" ), + TQString name = KInputDialog::getText( i18n( "Change Display Name - MSN Plugin" ), i18n( "Enter the new display name by which you want to be visible to your friends on MSN:" ), myself()->property( Kopete::Global::Properties::self()->nickName()).value().toString(), &ok ); @@ -416,8 +416,8 @@ void MSNAccount::slotNotifySocketClosed() if(reason == Kopete::Account::OtherClient) { //close all chat sessions, so new message will arive to the other client. - QValueList sessions = Kopete::ChatSessionManager::self()->sessions(); - QValueList::Iterator it; + TQValueList sessions = Kopete::ChatSessionManager::self()->sessions(); + TQValueList::Iterator it; for (it=sessions.begin() ; it != sessions.end() ; it++ ) { MSNChatSession *msnCS = dynamic_cast( *it ); @@ -449,7 +449,7 @@ void MSNAccount::slotStatusChanged( const Kopete::OnlineStatus &status ) { m_newContactList=false; - QDictIterator it( contacts() ); + TQDictIterator it( contacts() ); for ( ; it.current(); ++it ) { MSNContact *c = static_cast( *it ); @@ -470,9 +470,9 @@ void MSNAccount::slotStatusChanged( const Kopete::OnlineStatus &status ) } -void MSNAccount::slotPersonalMessageChanged( const QString& personalMessage ) +void MSNAccount::slotPersonalMessageChanged( const TQString& personalMessage ) { - QString oldPersonalMessage=myself()->property(MSNProtocol::protocol()->propPersonalMessage).value().toString() ; + TQString oldPersonalMessage=myself()->property(MSNProtocol::protocol()->propPersonalMessage).value().toString() ; if ( personalMessage != oldPersonalMessage ) { myself()->setProperty( MSNProtocol::protocol()->propPersonalMessage, personalMessage ); @@ -480,15 +480,15 @@ void MSNAccount::slotPersonalMessageChanged( const QString& personalMessage ) } } -void MSNAccount::setPublicName( const QString &publicName ) +void MSNAccount::setPublicName( const TQString &publicName ) { if ( m_notifySocket ) { - m_notifySocket->changePublicName( publicName, QString::null ); + m_notifySocket->changePublicName( publicName, TQString::null ); } } -void MSNAccount::setPersonalMessage( MSNProtocol::PersonalMessageType type, const QString &personalMessage ) +void MSNAccount::setPersonalMessage( MSNProtocol::PersonalMessageType type, const TQString &personalMessage ) { if ( m_notifySocket ) { @@ -501,7 +501,7 @@ void MSNAccount::setPersonalMessage( MSNProtocol::PersonalMessageType type, cons }*/ } -void MSNAccount::slotGroupAdded( const QString& groupName, const QString &groupGuid ) +void MSNAccount::slotGroupAdded( const TQString& groupName, const TQString &groupGuid ) { if ( m_groupList.contains( groupGuid ) ) { @@ -512,11 +512,11 @@ void MSNAccount::slotGroupAdded( const QString& groupName, const QString &groupG } //--------- Find the appropriate Kopete::Group, or create one ---------// - QPtrList groupList = Kopete::ContactList::self()->groups(); + TQPtrList groupList = Kopete::ContactList::self()->groups(); Kopete::Group *fallBack = 0L; //check if we have one in the old group list. if yes, update the id translate map. - for(QMap::Iterator it=m_oldGroupList.begin() ; it != m_oldGroupList.end() ; ++it ) + for(TQMap::Iterator it=m_oldGroupList.begin() ; it != m_oldGroupList.end() ; ++it ) { Kopete::Group *g=it.data(); if (g && g->pluginData( protocol(), accountId() + " displayName" ) == groupName && @@ -543,7 +543,7 @@ void MSNAccount::slotGroupAdded( const QString& groupName, const QString &groupG if ( g->pluginData( protocol(), accountId() + " id" ).toUInt() == groupNumber ) { m_groupList.insert( groupNumber, g ); - QString oldGroupName; + TQString oldGroupName; if ( g->pluginData( protocol(), accountId() + " displayName" ) != groupName ) { // The displayName of the group has been modified by another client @@ -589,14 +589,14 @@ void MSNAccount::slotGroupAdded( const QString& groupName, const QString &groupG // We have pending groups that we need add a contact to if ( tmp_addToNewGroup.contains(groupName) ) { - QStringList list=tmp_addToNewGroup[groupName]; - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + TQStringList list=tmp_addToNewGroup[groupName]; + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { - QString contactId = *it; + TQString contactId = *it; kdDebug( 14140 ) << k_funcinfo << "Adding to new group: " << contactId << endl; MSNContact *c = static_cast(contacts()[contactId]); if(c && c->hasProperty(MSNProtocol::protocol()->propGuid.key()) ) - notifySocket()->addContact( contactId, MSNProtocol::FL, QString::null, c->guid(), groupGuid ); + notifySocket()->addContact( contactId, MSNProtocol::FL, TQString::null, c->guid(), groupGuid ); else { // If we get to here, we're currently adding a new contact, add the groupGUID to the groupList @@ -604,14 +604,14 @@ void MSNAccount::slotGroupAdded( const QString& groupName, const QString &groupG if( tmp_addNewContactToGroup.contains( contactId ) ) tmp_addNewContactToGroup[contactId].append(groupGuid); else - tmp_addNewContactToGroup.insert(contactId, QStringList(groupGuid) ); + tmp_addNewContactToGroup.insert(contactId, TQStringList(groupGuid) ); } } tmp_addToNewGroup.remove(groupName); } } -void MSNAccount::slotGroupRenamed( const QString &groupGuid, const QString& groupName ) +void MSNAccount::slotGroupRenamed( const TQString &groupGuid, const TQString& groupName ) { if ( m_groupList.contains( groupGuid ) ) { @@ -625,16 +625,16 @@ void MSNAccount::slotGroupRenamed( const QString &groupGuid, const QString& grou } } -void MSNAccount::slotGroupRemoved( const QString& groupGuid ) +void MSNAccount::slotGroupRemoved( const TQString& groupGuid ) { if ( m_groupList.contains( groupGuid ) ) { - m_groupList[ groupGuid ]->setPluginData( protocol(), QMap() ); + m_groupList[ groupGuid ]->setPluginData( protocol(), TQMap() ); m_groupList.remove( groupGuid ); } } -void MSNAccount::addGroup( const QString &groupName, const QString& contactToAdd ) +void MSNAccount::addGroup( const TQString &groupName, const TQString& contactToAdd ) { if ( !contactToAdd.isNull() ) { @@ -648,7 +648,7 @@ void MSNAccount::addGroup( const QString &groupName, const QString& contactToAdd } else { - tmp_addToNewGroup.insert(groupName,QStringList(contactToAdd)); + tmp_addToNewGroup.insert(groupName,TQStringList(contactToAdd)); kdDebug( 14140 ) << k_funcinfo << "preparing to add " << groupName << " for " << contactToAdd << endl; } } @@ -682,7 +682,7 @@ void MSNAccount::slotKopeteGroupRemoved( Kopete::Group *g ) if ( !g->pluginData( protocol(), accountId() + " id" ).isEmpty() ) { - QString groupGuid = g->pluginData( protocol(), accountId() + " id" ); + TQString groupGuid = g->pluginData( protocol(), accountId() + " id" ); if ( !m_groupList.contains( groupGuid ) ) { // the group is maybe already removed in the server @@ -703,7 +703,7 @@ void MSNAccount::slotKopeteGroupRemoved( Kopete::Group *g ) Kopete::Group::topLevel()->setPluginData( protocol(), accountId() + " id", "" ); Kopete::Group::topLevel()->setPluginData( protocol(), accountId() + " displayName", g->pluginData( protocol(), accountId() + " displayName" ) ); - g->setPluginData( protocol(), accountId() + " id", QString::null ); // the group should be soon deleted, but make sure + g->setPluginData( protocol(), accountId() + " id", TQString::null ); // the group should be soon deleted, but make sure return; } @@ -712,7 +712,7 @@ void MSNAccount::slotKopeteGroupRemoved( Kopete::Group *g ) { bool still_have_contact=false; // if contact are contains only in the group we are removing, abort the - QDictIterator it( contacts() ); + TQDictIterator it( contacts() ); for ( ; it.current(); ++it ) { MSNContact *c = static_cast( it.current() ); @@ -734,10 +734,10 @@ void MSNAccount::slotKopeteGroupRemoved( Kopete::Group *g ) void MSNAccount::slotNewContactList() { m_oldGroupList=m_groupList; - for(QMap::Iterator it=m_oldGroupList.begin() ; it != m_oldGroupList.end() ; ++it ) + for(TQMap::Iterator it=m_oldGroupList.begin() ; it != m_oldGroupList.end() ; ++it ) { //they are about to be changed if(it.data()) - it.data()->setPluginData( protocol(), accountId() + " id", QString::null ); + it.data()->setPluginData( protocol(), accountId() + " id", TQString::null ); } m_allowList.clear(); @@ -745,13 +745,13 @@ void MSNAccount::slotNewContactList() m_reverseList.clear(); m_groupList.clear(); KConfigGroup *config=configGroup(); - config->writeEntry( "blockList" , QString::null ) ; - config->writeEntry( "allowList" , QString::null ); - config->writeEntry( "reverseList" , QString::null ); + config->writeEntry( "blockList" , TQString::null ) ; + config->writeEntry( "allowList" , TQString::null ); + config->writeEntry( "reverseList" , TQString::null ); // clear all date information which will be received. // if the information is not anymore on the server, it will not be received - QDictIterator it( contacts() ); + TQDictIterator it( contacts() ); for ( ; it.current(); ++it ) { MSNContact *c = static_cast( *it ); @@ -759,15 +759,15 @@ void MSNAccount::slotNewContactList() c->setAllowed( false ); c->setReversed( false ); c->setDeleted( true ); - c->setInfo( "PHH", QString::null ); - c->setInfo( "PHW", QString::null ); - c->setInfo( "PHM", QString::null ); + c->setInfo( "PHH", TQString::null ); + c->setInfo( "PHW", TQString::null ); + c->setInfo( "PHM", TQString::null ); c->removeProperty( MSNProtocol::protocol()->propGuid ); } m_newContactList=true; } -void MSNAccount::slotContactListed( const QString& handle, const QString& publicName, const QString &contactGuid, uint lists, const QString& groups ) +void MSNAccount::slotContactListed( const TQString& handle, const TQString& publicName, const TQString &contactGuid, uint lists, const TQString& groups ) { // On empty lists handle might be empty, ignore that // ignore also the myself contact. @@ -778,7 +778,7 @@ void MSNAccount::slotContactListed( const QString& handle, const QString& public if ( lists & 1 ) // FL { - QStringList contactGroups = QStringList::split( ",", groups, false ); + TQStringList contactGroups = TQStringList::split( ",", groups, false ); if ( c ) { if( !c->metaContact() ) @@ -799,11 +799,11 @@ void MSNAccount::slotContactListed( const QString& handle, const QString& public c->removeProperty( Kopete::Global::Properties::self()->nickName() ); c->setProperty( MSNProtocol::protocol()->propGuid, contactGuid); - const QMap oldServerGroups = c->serverGroups(); + const TQMap oldServerGroups = c->serverGroups(); c->clearServerGroups(); - for ( QStringList::ConstIterator it = contactGroups.begin(); it != contactGroups.end(); ++it ) + for ( TQStringList::ConstIterator it = contactGroups.begin(); it != contactGroups.end(); ++it ) { - QString newServerGroupID = *it; + TQString newServerGroupID = *it; if(m_groupList.contains(newServerGroupID)) { Kopete::Group *newServerGroup=m_groupList[ newServerGroupID ] ; @@ -816,12 +816,12 @@ void MSNAccount::slotContactListed( const QString& handle, const QString& public } } - for ( QMap::ConstIterator it = oldServerGroups.begin(); it != oldServerGroups.end(); ++it ) + for ( TQMap::ConstIterator it = oldServerGroups.begin(); it != oldServerGroups.end(); ++it ) { Kopete::Group *old_group=m_oldGroupList[it.key()]; if(old_group) { - QString oldnewID=old_group->pluginData(protocol() , accountId() +" id"); + TQString oldnewID=old_group->pluginData(protocol() , accountId() +" id"); if ( !oldnewID.isEmpty() && contactGroups.contains( oldnewID ) ) continue; //ok, it's correctn no need to do anything. @@ -847,10 +847,10 @@ void MSNAccount::slotContactListed( const QString& handle, const QString& public c->removeProperty( Kopete::Global::Properties::self()->nickName() ); c->setProperty( MSNProtocol::protocol()->propGuid, contactGuid ); - for ( QStringList::Iterator it = contactGroups.begin(); + for ( TQStringList::Iterator it = contactGroups.begin(); it != contactGroups.end(); ++it ) { - QString groupGuid = *it; + TQString groupGuid = *it; if(m_groupList.contains(groupGuid)) { c->contactAddedToGroup( groupGuid, m_groupList[ groupGuid ] ); @@ -874,25 +874,25 @@ void MSNAccount::slotContactListed( const QString& handle, const QString& public } } if ( lists & 2 ) - slotContactAdded( handle, "AL", publicName, QString::null, QString::null ); + slotContactAdded( handle, "AL", publicName, TQString::null, TQString::null ); else if(c) c->setAllowed(false); if ( lists & 4 ) - slotContactAdded( handle, "BL", publicName, QString::null, QString::null ); + slotContactAdded( handle, "BL", publicName, TQString::null, TQString::null ); else if(c) c->setBlocked(false); if ( lists & 8 ) - slotContactAdded( handle, "RL", publicName, QString::null, QString::null ); + slotContactAdded( handle, "RL", publicName, TQString::null, TQString::null ); else if(c) c->setReversed(false); if ( lists & 16 ) // This contact is on the pending list. Add to the reverse list and delete from the pending list { - notifySocket()->addContact( handle, MSNProtocol::RL, QString::null, QString::null, QString::null ); - notifySocket()->removeContact( handle, MSNProtocol::PL, QString::null, QString::null ); + notifySocket()->addContact( handle, MSNProtocol::RL, TQString::null, TQString::null, TQString::null ); + notifySocket()->removeContact( handle, MSNProtocol::PL, TQString::null, TQString::null ); } } -void MSNAccount::slotContactAdded( const QString& handle, const QString& list, const QString& publicName, const QString& contactGuid, const QString &groupGuid ) +void MSNAccount::slotContactAdded( const TQString& handle, const TQString& list, const TQString& publicName, const TQString& contactGuid, const TQString &groupGuid ) { if ( list == "FL" ) { @@ -912,17 +912,17 @@ void MSNAccount::slotContactAdded( const QString& handle, const QString& list, c // Add the new contact to the group he belongs. if ( tmp_addNewContactToGroup.contains(handle) ) { - QStringList list = tmp_addNewContactToGroup[handle]; - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + TQStringList list = tmp_addNewContactToGroup[handle]; + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { - QString groupGuid = *it; + TQString groupGuid = *it; // If the group didn't exist yet (yay for async operations), don't add the contact to the group // Let slotGroupAdded do it. if( m_groupList.contains(groupGuid) ) { kdDebug( 14140 ) << k_funcinfo << "Adding " << handle << " to group: " << groupGuid << endl; - notifySocket()->addContact( handle, MSNProtocol::FL, QString::null, contactGuid, groupGuid ); + notifySocket()->addContact( handle, MSNProtocol::FL, TQString::null, contactGuid, groupGuid ); c->contactAddedToGroup( groupGuid, m_groupList[ groupGuid ] ); @@ -971,7 +971,7 @@ void MSNAccount::slotContactAdded( const QString& handle, const QString& list, c if ( !handle.isEmpty() && !m_allowList.contains( handle ) && !m_blockList.contains( handle ) ) { kdDebug(14140) << k_funcinfo << "Trying to add contact to AL. " << endl; - notifySocket()->addContact(handle, MSNProtocol::AL, QString::null, QString::null, QString::null ); + notifySocket()->addContact(handle, MSNProtocol::AL, TQString::null, TQString::null, TQString::null ); } } else if ( list == "BL" ) @@ -1006,14 +1006,14 @@ void MSNAccount::slotContactAdded( const QString& handle, const QString& list, c // before I declare it good :- ) if ( !m_allowList.contains( handle ) && !m_blockList.contains( handle ) ) { - QString nick; //in most case, the public name is not know + TQString nick; //in most case, the public name is not know if(publicName!=handle) // so we don't whos it if it is not know nick=publicName; Kopete::UI::ContactAddedNotifyDialog *dialog= new Kopete::UI::ContactAddedNotifyDialog( handle,nick,this, Kopete::UI::ContactAddedNotifyDialog::InfoButton ); - QObject::connect(dialog,SIGNAL(applyClicked(const QString&)), - this,SLOT(slotContactAddedNotifyDialogClosed(const QString& ))); + TQObject::connect(dialog,TQT_SIGNAL(applyClicked(const TQString&)), + this,TQT_SLOT(slotContactAddedNotifyDialogClosed(const TQString& ))); dialog->show(); } } @@ -1026,7 +1026,7 @@ void MSNAccount::slotContactAdded( const QString& handle, const QString& list, c } } -void MSNAccount::slotContactRemoved( const QString& handle, const QString& list, const QString& contactGuid, const QString& groupGuid ) +void MSNAccount::slotContactRemoved( const TQString& handle, const TQString& list, const TQString& contactGuid, const TQString& groupGuid ) { kdDebug( 14140 ) << k_funcinfo << "handle: " << handle << " list: " << list << " contact-uid: " << contactGuid << endl; MSNContact *c=static_cast( contacts()[ handle ] ); @@ -1035,7 +1035,7 @@ void MSNAccount::slotContactRemoved( const QString& handle, const QString& list, m_blockList.remove( handle ); configGroup()->writeEntry( "blockList" , m_blockList ) ; if ( !m_allowList.contains( handle ) ) - notifySocket()->addContact( handle, MSNProtocol::AL, QString::null, QString::null, QString::null ); + notifySocket()->addContact( handle, MSNProtocol::AL, TQString::null, TQString::null, TQString::null ); if(c) c->setBlocked( false ); @@ -1045,7 +1045,7 @@ void MSNAccount::slotContactRemoved( const QString& handle, const QString& list, m_allowList.remove( handle ); configGroup()->writeEntry( "allowList" , m_allowList ) ; if ( !m_blockList.contains( handle ) ) - notifySocket()->addContact( handle, MSNProtocol::BL, QString::null, QString::null, QString::null ); + notifySocket()->addContact( handle, MSNProtocol::BL, TQString::null, TQString::null, TQString::null ); if(c) c->setAllowed( false ); @@ -1063,7 +1063,7 @@ void MSNAccount::slotContactRemoved( const QString& handle, const QString& list, /* InfoWidget *info = new InfoWidget( 0 ); info->title->setText( "" + i18n( "Contact removed!" ) +"" ); - QString dummy; + TQString dummy; dummy = "
" + imContact->getPublicName() + "( " +imContact->getHandle() +" )

"; dummy += i18n( "has removed you from his contact list!" ) + "
"; dummy += i18n( "This contact is now removed from your contact list" ); @@ -1077,15 +1077,15 @@ void MSNAccount::slotContactRemoved( const QString& handle, const QString& list, { // The FL list only use the contact GUID, use the contact referenced by the GUID. MSNContact *contactRemoved = findContactByGuid(contactGuid); - QStringList groupGuidList; + TQStringList groupGuidList; bool deleteContact = groupGuid.isEmpty() ? true : false; // Delete the contact when the group GUID is empty. // Remove the contact from the contact list for all the group he is a member. if( groupGuid.isEmpty() ) { if(contactRemoved) { - QPtrList groupList = contactRemoved->metaContact()->groups(); - for( QPtrList::Iterator it = groupList.begin(); it != groupList.end(); ++it ) + TQPtrList groupList = contactRemoved->metaContact()->groups(); + for( TQPtrList::Iterator it = groupList.begin(); it != groupList.end(); ++it ) { Kopete::Group *group = *it; if ( !group->pluginData( protocol(), accountId() + " id" ).isEmpty() ) @@ -1102,7 +1102,7 @@ void MSNAccount::slotContactRemoved( const QString& handle, const QString& list, if( !groupGuidList.isEmpty() ) { - QStringList::const_iterator stringIt; + TQStringList::const_iterator stringIt; for( stringIt = groupGuidList.begin(); stringIt != groupGuidList.end(); ++stringIt ) { // Contact is removed from the FL list, remove it from the group @@ -1114,7 +1114,7 @@ void MSNAccount::slotContactRemoved( const QString& handle, const QString& list, { bool still_have_contact=false; // if contact are contains only in the group we are removing, abort the - QDictIterator it( contacts() ); + TQDictIterator it( contacts() ); for ( ; it.current(); ++it ) { MSNContact *c2 = static_cast( it.current() ); @@ -1137,15 +1137,15 @@ void MSNAccount::slotContactRemoved( const QString& handle, const QString& list, } } -void MSNAccount::slotCreateChat( const QString& address, const QString& auth ) +void MSNAccount::slotCreateChat( const TQString& address, const TQString& auth ) { slotCreateChat( 0L, address, auth, m_msgHandle.first(), m_msgHandle.first() ); } -void MSNAccount::slotCreateChat( const QString& ID, const QString& address, const QString& auth, - const QString& handle_, const QString& publicName ) +void MSNAccount::slotCreateChat( const TQString& ID, const TQString& address, const TQString& auth, + const TQString& handle_, const TQString& publicName ) { - QString handle = handle_.lower(); + TQString handle = handle_.lower(); if ( handle.isEmpty() ) { @@ -1189,7 +1189,7 @@ void MSNAccount::slotCreateChat( const QString& ID, const QString& address, cons if ( !ID.isEmpty() && notifyNewChat ) { // this temporary message should open the window if they not exist - QString body = i18n( "%1 has started a chat with you" ).arg( c->metaContact()->displayName() ); + TQString body = i18n( "%1 has started a chat with you" ).arg( c->metaContact()->displayName() ); Kopete::Message tmpMsg = Kopete::Message( c, manager->members(), body, Kopete::Message::Internal, Kopete::Message::PlainText ); manager->appendMessage( tmpMsg ); } @@ -1200,7 +1200,7 @@ void MSNAccount::slotCreateChat( const QString& ID, const QString& address, cons m_msgHandle.pop_front(); } -void MSNAccount::slotStartChatSession( const QString& handle ) +void MSNAccount::slotStartChatSession( const TQString& handle ) { // First create a message manager, because we might get an existing // manager back, in which case we likely also have an active switchboard @@ -1218,7 +1218,7 @@ void MSNAccount::slotStartChatSession( const QString& handle ) } } -void MSNAccount::slotContactAddedNotifyDialogClosed(const QString& handle) +void MSNAccount::slotContactAddedNotifyDialogClosed(const TQString& handle) { const Kopete::UI::ContactAddedNotifyDialog *dialog = dynamic_cast(sender()); @@ -1242,29 +1242,29 @@ void MSNAccount::slotContactAddedNotifyDialogClosed(const QString& handle) if ( !dialog->authorized() ) { if ( m_allowList.contains( handle ) ) - m_notifySocket->removeContact( handle, MSNProtocol::AL, QString::null, QString::null ); + m_notifySocket->removeContact( handle, MSNProtocol::AL, TQString::null, TQString::null ); else if ( !m_blockList.contains( handle ) ) - m_notifySocket->addContact( handle, MSNProtocol::BL, QString::null, QString::null, QString::null ); + m_notifySocket->addContact( handle, MSNProtocol::BL, TQString::null, TQString::null, TQString::null ); } else { if ( m_blockList.contains( handle ) ) - m_notifySocket->removeContact( handle, MSNProtocol::BL, QString::null, QString::null ); + m_notifySocket->removeContact( handle, MSNProtocol::BL, TQString::null, TQString::null ); else if ( !m_allowList.contains( handle ) ) - m_notifySocket->addContact( handle, MSNProtocol::AL, QString::null, QString::null, QString::null ); + m_notifySocket->addContact( handle, MSNProtocol::AL, TQString::null, TQString::null, TQString::null ); } } -void MSNAccount::slotGlobalIdentityChanged( const QString &key, const QVariant &value ) +void MSNAccount::slotGlobalIdentityChanged( const TQString &key, const TQVariant &value ) { if( !configGroup()->readBoolEntry("ExcludeGlobalIdentity", false) ) { if(key == Kopete::Global::Properties::self()->nickName().key()) { - QString oldNick = myself()->property( Kopete::Global::Properties::self()->nickName()).value().toString(); - QString newNick = value.toString(); + TQString oldNick = myself()->property( Kopete::Global::Properties::self()->nickName()).value().toString(); + TQString newNick = value.toString(); if(newNick != oldNick) { @@ -1280,9 +1280,9 @@ void MSNAccount::slotGlobalIdentityChanged( const QString &key, const QVariant & } } -void MSNAccount::slotErrorMessageReceived( int type, const QString &msg ) +void MSNAccount::slotErrorMessageReceived( int type, const TQString &msg ) { - QString caption = i18n( "MSN Plugin" ); + TQString caption = i18n( "MSN Plugin" ); // Use different notification type based on the error context. switch(type) @@ -1316,7 +1316,7 @@ void MSNAccount::slotErrorMessageReceived( int type, const QString &msg ) } } -bool MSNAccount::createContact( const QString &contactId, Kopete::MetaContact *metaContact ) +bool MSNAccount::createContact( const TQString &contactId, Kopete::MetaContact *metaContact ) { if ( !metaContact->isTemporary() && m_notifySocket) { @@ -1339,14 +1339,14 @@ bool MSNAccount::createContact( const QString &contactId, Kopete::MetaContact *m } -void MSNAccount::addContactServerside(const QString &contactId, QPtrList groupList) +void MSNAccount::addContactServerside(const TQString &contactId, TQPtrList groupList) { // First of all, fill the temporary group list. The contact will be moved to his group(s). // When we receive back his contact GUID(required to move a contact between groups) for( Kopete::Group *group = groupList.first(); group; group = groupList.next() ) { // TODO: It it time that libkopete generate a unique ID that contains protocols, account and contact id. - QString groupId = group->pluginData( protocol(), accountId() + " id" ); + TQString groupId = group->pluginData( protocol(), accountId() + " id" ); // If the groupId is empty, that's mean the Kopete group is not on the MSN server. if( !groupId.isEmpty() ) { @@ -1354,8 +1354,8 @@ void MSNAccount::addContactServerside(const QString &contactId, QPtrListsetPluginData( protocol() , accountId() + " id" , QString::null); - group->setPluginData( protocol() , accountId() + " displayName" , QString::null); + group->setPluginData( protocol() , accountId() + " id" , TQString::null); + group->setPluginData( protocol() , accountId() + " displayName" , TQString::null); kdDebug( 14140 ) << k_funcinfo << " Group " << group->displayName() << " marked with id #" << groupId << " does not seems to be anymore on the server" << endl; // Add the group on MSN server, will fix the corruption. @@ -1368,7 +1368,7 @@ void MSNAccount::addContactServerside(const QString &contactId, QPtrListaddContact( contactId, MSNProtocol::FL, contactId, QString::null, QString::null ); + m_notifySocket->addContact( contactId, MSNProtocol::FL, contactId, TQString::null, TQString::null ); } -MSNContact *MSNAccount::findContactByGuid(const QString &contactGuid) +MSNContact *MSNAccount::findContactByGuid(const TQString &contactGuid) { kdDebug(14140) << k_funcinfo << "Looking for " << contactGuid << endl; - QDictIterator it( contacts() ); + TQDictIterator it( contacts() ); for ( ; it.current(); ++it ) { MSNContact *c = dynamic_cast( it.current() ); @@ -1412,17 +1412,17 @@ bool MSNAccount::isHotmail() const return m_openInboxAction->isEnabled(); } -QString MSNAccount::pictureUrl() +TQString MSNAccount::pictureUrl() { return m_pictureFilename; } -void MSNAccount::setPictureUrl(const QString &url) +void MSNAccount::setPictureUrl(const TQString &url) { m_pictureFilename = url; } -QString MSNAccount::pictureObject() +TQString MSNAccount::pictureObject() { if(m_pictureObj.isNull()) resetPictureObject(true); //silent=true to keep infinite loop away @@ -1431,7 +1431,7 @@ QString MSNAccount::pictureObject() void MSNAccount::resetPictureObject(bool silent, bool force) { - QString old=m_pictureObj; + TQString old=m_pictureObj; if(!configGroup()->readBoolEntry("exportCustomPicture") && !force) { @@ -1441,7 +1441,7 @@ void MSNAccount::resetPictureObject(bool silent, bool force) else { // Check if the picture is a 96x96 image, if not scale, crop and save. - QImage picture(m_pictureFilename); + TQImage picture(m_pictureFilename); if(picture.isNull()) { m_pictureObj=""; @@ -1452,7 +1452,7 @@ void MSNAccount::resetPictureObject(bool silent, bool force) if(picture.width() != 96 || picture.height() != 96) { // Save to a new location in msnpictures. - QString newLocation( locateLocal( "appdata", "msnpictures/"+ KURL(m_pictureFilename).fileName().lower() ) ); + TQString newLocation( locateLocal( "appdata", "msnpictures/"+ KURL(m_pictureFilename).fileName().lower() ) ); // Scale and crop the picture. picture = MSNProtocol::protocol()->scalePicture(picture); @@ -1467,7 +1467,7 @@ void MSNAccount::resetPictureObject(bool silent, bool force) } } - QFile pictFile( m_pictureFilename ); + TQFile pictFile( m_pictureFilename ); if(!pictFile.open(IO_ReadOnly)) { m_pictureObj=""; @@ -1475,12 +1475,12 @@ void MSNAccount::resetPictureObject(bool silent, bool force) } else { - QByteArray ar=pictFile.readAll(); - QString sha1d= QString((KCodecs::base64Encode(SHA1::hash(ar)))); + TQByteArray ar=pictFile.readAll(); + TQString sha1d= TQString((KCodecs::base64Encode(SHA1::hash(ar)))); - QString size=QString::number( pictFile.size() ); - QString all= "Creator"+accountId()+"Size"+size+"Type3Locationkopete.tmpFriendlyAAA=SHA1D"+ sha1d; - m_pictureObj=""; + TQString size=TQString::number( pictFile.size() ); + TQString all= "Creator"+accountId()+"Size"+size+"Type3Locationkopete.tmpFriendlyAAA=SHA1D"+ sha1d; + m_pictureObj=""; myself()->setProperty( Kopete::Global::Properties::self()->photo() , m_pictureFilename ); } } diff --git a/kopete/protocols/msn/msnaccount.h b/kopete/protocols/msn/msnaccount.h index 7fbee16b..5f7352e3 100644 --- a/kopete/protocols/msn/msnaccount.h +++ b/kopete/protocols/msn/msnaccount.h @@ -19,7 +19,7 @@ #ifndef MSNACCOUNT_H #define MSNACCOUNT_H -#include +#include #include "kopetepasswordedaccount.h" @@ -42,7 +42,7 @@ class MSNAccount : public Kopete::PasswordedAccount Q_OBJECT public: - MSNAccount( MSNProtocol *parent, const QString &accountID, const char *name = 0L ); + MSNAccount( MSNProtocol *parent, const TQString &accountID, const char *name = 0L ); /* * return the menu for this account @@ -53,13 +53,13 @@ public: /** * change the publicName to this new name */ - void setPublicName( const QString &name ); - void setPersonalMessage(MSNProtocol::PersonalMessageType type, const QString &personalMessage ); + void setPublicName( const TQString &name ); + void setPersonalMessage(MSNProtocol::PersonalMessageType type, const TQString &personalMessage ); /** * Returns the address of the MSN server */ - QString serverName(); + TQString serverName(); /** * Returns the address of the MSN server port @@ -77,17 +77,17 @@ public: /** * Return the picture url. */ - QString pictureUrl(); + TQString pictureUrl(); /** * Set the picture url. */ - void setPictureUrl(const QString &url); + void setPictureUrl(const TQString &url); /** * return the tag of the display picture */ - QString pictureObject(); + TQString pictureObject(); /** * reset the . This method should be called if the displayimage has changed @@ -107,25 +107,25 @@ public: * Return the client ID for the myself contact of this account. * It is dynamic to see if we really have a webcam or not. */ - QString myselfClientId() const; + TQString myselfClientId() const; public slots: - virtual void connectWithPassword( const QString &password ) ; + virtual void connectWithPassword( const TQString &password ) ; virtual void disconnect() ; - virtual void setOnlineStatus( const Kopete::OnlineStatus &status , const QString &reason = QString::null); + virtual void setOnlineStatus( const Kopete::OnlineStatus &status , const TQString &reason = TQString::null); /** * Ask to the account to create a new chat session */ - void slotStartChatSession( const QString& handle ); + void slotStartChatSession( const TQString& handle ); /** * Single slot to display error message. */ - void slotErrorMessageReceived( int type, const QString &msg ); + void slotErrorMessageReceived( int type, const TQString &msg ); protected: - virtual bool createContact( const QString &contactId, Kopete::MetaContact *parentContact ); + virtual bool createContact( const TQString &contactId, Kopete::MetaContact *parentContact ); private slots: @@ -144,36 +144,36 @@ private slots: // notifySocket related void slotStatusChanged( const Kopete::OnlineStatus &status ); void slotNotifySocketClosed(); - void slotPersonalMessageChanged(const QString& personalMessage); - void slotContactRemoved(const QString& handle, const QString& list, const QString& contactGuid, const QString& groupGuid ); - void slotContactAdded(const QString& handle, const QString& list, const QString& publicName, const QString& contactGuid, const QString &groupGuid ); - void slotContactListed( const QString& handle, const QString& publicName, const QString &contactGuid, uint lists, const QString& groups ); + void slotPersonalMessageChanged(const TQString& personalMessage); + void slotContactRemoved(const TQString& handle, const TQString& list, const TQString& contactGuid, const TQString& groupGuid ); + void slotContactAdded(const TQString& handle, const TQString& list, const TQString& publicName, const TQString& contactGuid, const TQString &groupGuid ); + void slotContactListed( const TQString& handle, const TQString& publicName, const TQString &contactGuid, uint lists, const TQString& groups ); void slotNewContactList(); /** * The group has successful renamed in the server * groupName: is new new group name */ - void slotGroupRenamed(const QString &groupGuid, const QString& groupName ); + void slotGroupRenamed(const TQString &groupGuid, const TQString& groupName ); /** * A new group was created on the server (or received durring an LSG command) */ - void slotGroupAdded( const QString& groupName, const QString &groupGuid ); + void slotGroupAdded( const TQString& groupName, const TQString &groupGuid ); /** * Group was removed from the server */ - void slotGroupRemoved( const QString &groupGuid ); + void slotGroupRemoved( const TQString &groupGuid ); /** * Incoming RING command: connect to the Switchboard server and send * the startChat signal */ - void slotCreateChat( const QString& sessionID, const QString& address, const QString& auth, - const QString& handle, const QString& publicName ); + void slotCreateChat( const TQString& sessionID, const TQString& address, const TQString& auth, + const TQString& handle, const TQString& publicName ); /** * Incoming XFR command: this is an result from * slotStartChatSession(handle) * connect to the switchboard server and sen startChat signal */ - void slotCreateChat( const QString& address, const QString& auth); + void slotCreateChat( const TQString& address, const TQString& auth); // ui related @@ -190,17 +190,17 @@ private slots: /** * add contact ui */ - void slotContactAddedNotifyDialogClosed( const QString &handle); + void slotContactAddedNotifyDialogClosed( const TQString &handle); /** * When the dispatch server sends us the notification server to use. */ - void createNotificationServer( const QString &host, uint port ); + void createNotificationServer( const TQString &host, uint port ); /** * When a global identity key get changed. */ - void slotGlobalIdentityChanged( const QString &key, const QVariant &value ); + void slotGlobalIdentityChanged( const TQString &key, const TQVariant &value ); private: MSNNotifySocket *m_notifySocket; @@ -211,7 +211,7 @@ private: // status which will be using for connecting Kopete::OnlineStatus m_connectstatus; - QStringList m_msgHandle; + TQStringList m_msgHandle; bool m_newContactList; @@ -220,35 +220,35 @@ private: * Add the contact on the server in the given groups. * this is a helper function called bu createContact and slotStatusChanged */ - void addContactServerside(const QString &contactId, QPtrList groupList); + void addContactServerside(const TQString &contactId, TQPtrList groupList); public: //FIXME: should be private - QMap m_groupList; + TQMap m_groupList; - void addGroup( const QString &groupName, const QString &contactToAdd = QString::null ); + void addGroup( const TQString &groupName, const TQString &contactToAdd = TQString::null ); /** * Find and retrive a MSNContact by its contactGuid. (Helper function) */ - MSNContact *findContactByGuid(const QString &contactGuid); + MSNContact *findContactByGuid(const TQString &contactGuid); private: // server data - QStringList m_allowList; - QStringList m_blockList; - QStringList m_reverseList; + TQStringList m_allowList; + TQStringList m_blockList; + TQStringList m_reverseList; Kopete::MetaContact *m_addWizard_metaContact; - QMap< QString, QStringList > tmp_addToNewGroup; - QMap< QString, QStringList > tmp_addNewContactToGroup; + TQMap< TQString, TQStringList > tmp_addToNewGroup; + TQMap< TQString, TQStringList > tmp_addNewContactToGroup; - QString m_pictureObj; //a cache of the - QString m_pictureFilename; // the picture filename. + TQString m_pictureObj; //a cache of the + TQString m_pictureFilename; // the picture filename. //this is the translation between old to new groups id when syncing from server. - QMap m_oldGroupList; + TQMap m_oldGroupList; /** * I need the password in createNotificationServer. @@ -256,7 +256,7 @@ private: * at this place. so i'm forced to keep it here. * I would like an API to request the password WITHOUT askling it. */ - QString m_password; + TQString m_password; /** * Cliend ID is a bitfield that contains supported features for a MSN contact. diff --git a/kopete/protocols/msn/msnaddcontactpage.cpp b/kopete/protocols/msn/msnaddcontactpage.cpp index 337939e6..8bdf77a1 100644 --- a/kopete/protocols/msn/msnaddcontactpage.cpp +++ b/kopete/protocols/msn/msnaddcontactpage.cpp @@ -13,8 +13,8 @@ */ -#include -#include +#include +#include #include #include @@ -25,10 +25,10 @@ #include "kopeteaccount.h" #include "kopeteuiglobal.h" -MSNAddContactPage::MSNAddContactPage(bool connected, QWidget *parent, const char *name ) +MSNAddContactPage::MSNAddContactPage(bool connected, TQWidget *parent, const char *name ) : AddContactPage(parent,name) { - (new QVBoxLayout(this))->setAutoAdd(true); + (new TQVBoxLayout(this))->setAutoAdd(true); /* if ( connected ) {*/ msndata = new msnAddUI(this); @@ -41,8 +41,8 @@ MSNAddContactPage::MSNAddContactPage(bool connected, QWidget *parent, const char /* } else { - noaddMsg1 = new QLabel( i18n( "You need to be connected to be able to add contacts." ), this ); - noaddMsg2 = new QLabel( i18n( "Please connect to the MSN network and try again." ), this ); + noaddMsg1 = new TQLabel( i18n( "You need to be connected to be able to add contacts." ), this ); + noaddMsg2 = new TQLabel( i18n( "Please connect to the MSN network and try again." ), this ); canadd = false; }*/ @@ -55,7 +55,7 @@ bool MSNAddContactPage::apply( Kopete::Account* i, Kopete::MetaContact*m ) { if ( validateData() ) { - QString userid = msndata->addID->text(); + TQString userid = msndata->addID->text(); return i->addContact( userid , m, Kopete::Account::ChangeKABC ); } return false; @@ -67,7 +67,7 @@ bool MSNAddContactPage::validateData() if(!canadd) return false; - QString userid = msndata->addID->text(); + TQString userid = msndata->addID->text(); if(MSNProtocol::validContactId(userid)) return true; diff --git a/kopete/protocols/msn/msnaddcontactpage.h b/kopete/protocols/msn/msnaddcontactpage.h index c2e3fb3b..4b51a15e 100644 --- a/kopete/protocols/msn/msnaddcontactpage.h +++ b/kopete/protocols/msn/msnaddcontactpage.h @@ -2,9 +2,9 @@ #ifndef MSNADDCONTACTPAGE_H #define MSNADDCONTACTPAGE_H -#include +#include #include -#include +#include /** *@author duncan @@ -16,11 +16,11 @@ class MSNAddContactPage : public AddContactPage { Q_OBJECT public: - MSNAddContactPage(bool connected, QWidget *parent=0, const char *name=0); + MSNAddContactPage(bool connected, TQWidget *parent=0, const char *name=0); ~MSNAddContactPage(); msnAddUI *msndata; - QLabel *noaddMsg1; - QLabel *noaddMsg2; + TQLabel *noaddMsg1; + TQLabel *noaddMsg2; bool canadd; virtual bool validateData(); virtual bool apply( Kopete::Account*, Kopete::MetaContact* ); diff --git a/kopete/protocols/msn/msnchallengehandler.cpp b/kopete/protocols/msn/msnchallengehandler.cpp index e0bcc987..46d4b8a0 100644 --- a/kopete/protocols/msn/msnchallengehandler.cpp +++ b/kopete/protocols/msn/msnchallengehandler.cpp @@ -19,12 +19,12 @@ #include "msnchallengehandler.h" -#include +#include #include #include -MSNChallengeHandler::MSNChallengeHandler(const QString& productKey, const QString& productId) +MSNChallengeHandler::MSNChallengeHandler(const TQString& productKey, const TQString& productId) { m_productKey = productKey; m_productId = productId; @@ -36,17 +36,17 @@ MSNChallengeHandler::~MSNChallengeHandler() kdDebug(14140) << k_funcinfo << endl; } -QString MSNChallengeHandler::computeHash(const QString& challengeString) +TQString MSNChallengeHandler::computeHash(const TQString& challengeString) { // Step One: THe MD5 Hash. // Combine the received challenge string with the product key. KMD5 md5((challengeString + m_productKey).utf8()); - QCString digest = md5.hexDigest(); + TQCString digest = md5.hexDigest(); kdDebug(14140) << k_funcinfo << "md5: " << digest << endl; - QValueVector md5Integers(4); + TQValueVector md5Integers(4); for(Q_UINT32 i=0; i < md5Integers.count(); i++) { md5Integers[i] = hexSwap(digest.mid(i*8, 8)).toUInt(0, 16) & 0x7FFFFFFF; @@ -55,21 +55,21 @@ QString MSNChallengeHandler::computeHash(const QString& challengeString) // Step Two: Create the challenge string key - QString challengeKey = challengeString + m_productId; + TQString challengeKey = challengeString + m_productId; // Pad to multiple of 8. challengeKey = challengeKey.leftJustify(challengeKey.length() + (8 - challengeKey.length() % 8), '0'); kdDebug(14140) << k_funcinfo << "challenge key: " << challengeKey << endl; - QValueVector challengeIntegers(challengeKey.length() / 4); + TQValueVector challengeIntegers(challengeKey.length() / 4); for(Q_UINT32 i=0; i < challengeIntegers.count(); i++) { - QString sNum = challengeKey.mid(i*4, 4), sNumHex; + TQString sNum = challengeKey.mid(i*4, 4), sNumHex; // Go through the number string, determining the hex equivalent of each value // and add that to our new hex string for this number. for(uint j=0; j < sNum.length(); j++) { - sNumHex += QString::number((int)sNum[j].latin1(), 16); + sNumHex += TQString::number((int)sNum[j].latin1(), 16); } // swap because of the byte ordering issue. @@ -87,19 +87,19 @@ QString MSNChallengeHandler::computeHash(const QString& challengeString) // Step Four: Create the final hash key. - QString upper = QString::number(QString(digest.mid(0, 16)).toULongLong(0, 16)^key, 16); + TQString upper = TQString::number(TQString(digest.mid(0, 16)).toULongLong(0, 16)^key, 16); if(upper.length() % 16 != 0) upper = upper.rightJustify(upper.length() + (16 - upper.length() % 16), '0'); - QString lower = QString::number(QString(digest.mid(16, 16)).toULongLong(0, 16)^key, 16); + TQString lower = TQString::number(TQString(digest.mid(16, 16)).toULongLong(0, 16)^key, 16); if(lower.length() % 16 != 0) lower = lower.rightJustify(lower.length() + (16 - lower.length() % 16), '0'); return (upper + lower); } -Q_INT64 MSNChallengeHandler::createHashKey(const QValueVector& md5Integers, - const QValueVector& challengeIntegers) +Q_INT64 MSNChallengeHandler::createHashKey(const TQValueVector& md5Integers, + const TQValueVector& challengeIntegers) { kdDebug(14140) << k_funcinfo << "Creating 64-bit key." << endl; @@ -119,22 +119,22 @@ Q_INT64 MSNChallengeHandler::createHashKey(const QValueVector& md5Integ high = (high + md5Integers[1]) % 0x7FFFFFFF; low = (low + md5Integers[3]) % 0x7FFFFFFF; - QDataStream buffer(QByteArray(8), IO_ReadWrite); - buffer.setByteOrder(QDataStream::LittleEndian); + TQDataStream buffer(TQByteArray(8), IO_ReadWrite); + buffer.setByteOrder(TQDataStream::LittleEndian); buffer << (Q_INT32)high; buffer << (Q_INT32)low; buffer.device()->reset(); - buffer.setByteOrder(QDataStream::BigEndian); + buffer.setByteOrder(TQDataStream::BigEndian); Q_INT64 key; buffer >> key; return key; } -QString MSNChallengeHandler::hexSwap(const QString& in) +TQString MSNChallengeHandler::hexSwap(const TQString& in) { - QString sHex = in, swapped; + TQString sHex = in, swapped; while(sHex.length() > 0) { swapped = swapped + sHex.mid(sHex.length() - 2, 2); @@ -143,7 +143,7 @@ QString MSNChallengeHandler::hexSwap(const QString& in) return swapped; } -QString MSNChallengeHandler::productId() +TQString MSNChallengeHandler::productId() { return m_productId; } diff --git a/kopete/protocols/msn/msnchallengehandler.h b/kopete/protocols/msn/msnchallengehandler.h index 9e866560..8ae8c3aa 100644 --- a/kopete/protocols/msn/msnchallengehandler.h +++ b/kopete/protocols/msn/msnchallengehandler.h @@ -20,8 +20,8 @@ #ifndef MSNCHALLENGEHANDLER_H #define MSNCHALLENGEHANDLER_H -#include -#include +#include +#include /** * Provides a simple way to compute a msn challenge response hash key. @@ -32,33 +32,33 @@ class MSNChallengeHandler : public QObject { Q_OBJECT public: - MSNChallengeHandler(const QString& productKey, const QString& productId); + MSNChallengeHandler(const TQString& productKey, const TQString& productId); ~MSNChallengeHandler(); /** * Computes the response hash string for the specified challenge string. */ - QString computeHash(const QString& challengeString); + TQString computeHash(const TQString& challengeString); /** * Returns the product id used by the challenge handler. */ - QString productId(); + TQString productId(); private: /** * Creates a 64-bit hash key. */ - Q_INT64 createHashKey(const QValueVector& md5Integers, const QValueVector& challengeIntegers); + Q_INT64 createHashKey(const TQValueVector& md5Integers, const TQValueVector& challengeIntegers); /** * Swaps the bytes in a hex string. */ - QString hexSwap(const QString& in); + TQString hexSwap(const TQString& in); - QString m_productKey; - QString m_productId; + TQString m_productKey; + TQString m_productId; }; #endif diff --git a/kopete/protocols/msn/msnchatsession.cpp b/kopete/protocols/msn/msnchatsession.cpp index 3bf5d0c6..f799edc1 100644 --- a/kopete/protocols/msn/msnchatsession.cpp +++ b/kopete/protocols/msn/msnchatsession.cpp @@ -17,11 +17,11 @@ #include "msnchatsession.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -66,43 +66,43 @@ MSNChatSession::MSNChatSession( Kopete::Protocol *protocol, const Kopete::Contac setInstance(protocol->instance()); - connect( this, SIGNAL( messageSent( Kopete::Message&, + connect( this, TQT_SIGNAL( messageSent( Kopete::Message&, Kopete::ChatSession* ) ), - this, SLOT( slotMessageSent( Kopete::Message&, + this, TQT_SLOT( slotMessageSent( Kopete::Message&, Kopete::ChatSession* ) ) ); - connect( this, SIGNAL( invitation(MSNInvitation*& , const QString & , long unsigned int , MSNChatSession* , MSNContact* ) ) , - protocol, SIGNAL( invitation(MSNInvitation*& , const QString & , long unsigned int , MSNChatSession* , MSNContact* ) ) ); + connect( this, TQT_SIGNAL( invitation(MSNInvitation*& , const TQString & , long unsigned int , MSNChatSession* , MSNContact* ) ) , + protocol, TQT_SIGNAL( invitation(MSNInvitation*& , const TQString & , long unsigned int , MSNChatSession* , MSNContact* ) ) ); m_actionInvite = new KActionMenu( i18n( "&Invite" ), "kontact_contacts", actionCollection(), "msnInvite" ); - connect ( m_actionInvite->popupMenu() , SIGNAL( aboutToShow() ) , this , SLOT(slotActionInviteAboutToShow() ) ) ; + connect ( m_actionInvite->popupMenu() , TQT_SIGNAL( aboutToShow() ) , this , TQT_SLOT(slotActionInviteAboutToShow() ) ) ; #if !defined NDEBUG - new KAction( i18n( "Send Raw C&ommand..." ), 0, this, SLOT( slotDebugRawCommand() ), actionCollection(), "msnDebugRawCommand" ) ; + new KAction( i18n( "Send Raw C&ommand..." ), 0, this, TQT_SLOT( slotDebugRawCommand() ), actionCollection(), "msnDebugRawCommand" ) ; #endif - m_actionNudge=new KAction( i18n( "Send Nudge" ), "bell", 0, this, SLOT(slotSendNudge() ), actionCollection(), "msnSendNudge" ) ; + m_actionNudge=new KAction( i18n( "Send Nudge" ), "bell", 0, this, TQT_SLOT(slotSendNudge() ), actionCollection(), "msnSendNudge" ) ; #if MSN_WEBCAM // Invite to receive webcam action - m_actionWebcamReceive=new KAction( i18n( "View Contact's Webcam" ), "webcamreceive", 0, this, SLOT(slotWebcamReceive()), actionCollection(), "msnWebcamReceive" ) ; + m_actionWebcamReceive=new KAction( i18n( "View Contact's Webcam" ), "webcamreceive", 0, this, TQT_SLOT(slotWebcamReceive()), actionCollection(), "msnWebcamReceive" ) ; //Send webcam action - m_actionWebcamSend=new KAction( i18n( "Send Webcam" ), "webcamsend", 0, this, SLOT(slotWebcamSend()), actionCollection(), "msnWebcamSend" ) ; + m_actionWebcamSend=new KAction( i18n( "Send Webcam" ), "webcamsend", 0, this, TQT_SLOT(slotWebcamSend()), actionCollection(), "msnWebcamSend" ) ; #endif - new KAction( i18n( "Send File" ),"attach", 0, this, SLOT( slotSendFile() ), actionCollection(), "msnSendFile" ); + new KAction( i18n( "Send File" ),"attach", 0, this, TQT_SLOT( slotSendFile() ), actionCollection(), "msnSendFile" ); MSNContact *c = static_cast( others.first() ); - (new KAction( i18n( "Request Display Picture" ), "image", 0, this, SLOT( slotRequestPicture() ), actionCollection(), "msnRequestDisplayPicture" ))->setEnabled(!c->object().isEmpty()); + (new KAction( i18n( "Request Display Picture" ), "image", 0, this, TQT_SLOT( slotRequestPicture() ), actionCollection(), "msnRequestDisplayPicture" ))->setEnabled(!c->object().isEmpty()); if ( !c->object().isEmpty() ) { - connect( c, SIGNAL( displayPictureChanged() ), this, SLOT( slotDisplayPictureChanged() ) ); - m_image = new QLabel( 0L, "kde toolbar widget" ); - new KWidgetAction( m_image, i18n( "MSN Display Picture" ), 0, this, SLOT( slotRequestPicture() ), actionCollection(), "msnDisplayPicture" ); + connect( c, TQT_SIGNAL( displayPictureChanged() ), this, TQT_SLOT( slotDisplayPictureChanged() ) ); + m_image = new TQLabel( 0L, "kde toolbar widget" ); + new KWidgetAction( m_image, i18n( "MSN Display Picture" ), 0, this, TQT_SLOT( slotRequestPicture() ), actionCollection(), "msnDisplayPicture" ); if(c->hasProperty(Kopete::Global::Properties::self()->photo().key()) ) { //if the view doesn't exist yet, we will be unable to get the size of the toolbar @@ -110,7 +110,7 @@ MSNChatSession::MSNChatSession( Kopete::Protocol *protocol, const Kopete::Contac //How to know when a our view is created? We can't. // but chances are the next created view will be for this KMM // And if it is not? never mind. the icon will just be sized 22x22 - connect( Kopete::ChatSessionManager::self() , SIGNAL(viewActivated(KopeteView* )) , this, SLOT(slotDisplayPictureChanged()) ); + connect( Kopete::ChatSessionManager::self() , TQT_SIGNAL(viewActivated(KopeteView* )) , this, TQT_SLOT(slotDisplayPictureChanged()) ); //it's viewActivated and not viewCreated because the view get his mainwindow only when it is shown. } } @@ -132,7 +132,7 @@ MSNChatSession::~MSNChatSession() // if(m_chatService) // delete m_chatService; - QMap::Iterator it; + TQMap::Iterator it; for( it = m_invitations.begin(); it != m_invitations.end() ; it = m_invitations.begin()) { delete *it; @@ -140,8 +140,8 @@ MSNChatSession::~MSNChatSession() } } -void MSNChatSession::createChat( const QString &handle, - const QString &address, const QString &auth, const QString &ID ) +void MSNChatSession::createChat( const TQString &handle, + const TQString &address, const TQString &auth, const TQString &ID ) { /* disabled because i don't want to reopen a chatwindow if we just closed it * and the contact take much time to type his message @@ -163,46 +163,46 @@ void MSNChatSession::createChat( const QString &handle, m_chatService->setMsgHandle( handle ); m_chatService->connectToSwitchBoard( ID, address, auth ); - connect( m_chatService, SIGNAL( userJoined(const QString&,const QString&,bool)), - this, SLOT( slotUserJoined(const QString&,const QString&,bool) ) ); - connect( m_chatService, SIGNAL( userLeft(const QString&,const QString&)), - this, SLOT( slotUserLeft(const QString&,const QString&) ) ); - connect( m_chatService, SIGNAL( msgReceived( Kopete::Message & ) ), - this, SLOT( slotMessageReceived( Kopete::Message & ) ) ); - connect( m_chatService, SIGNAL( switchBoardClosed() ), - this, SLOT( slotSwitchBoardClosed() ) ); - connect( m_chatService, SIGNAL( receivedTypingMsg( const QString &, bool ) ), - this, SLOT( receivedTypingMsg( const QString &, bool ) ) ); + connect( m_chatService, TQT_SIGNAL( userJoined(const TQString&,const TQString&,bool)), + this, TQT_SLOT( slotUserJoined(const TQString&,const TQString&,bool) ) ); + connect( m_chatService, TQT_SIGNAL( userLeft(const TQString&,const TQString&)), + this, TQT_SLOT( slotUserLeft(const TQString&,const TQString&) ) ); + connect( m_chatService, TQT_SIGNAL( msgReceived( Kopete::Message & ) ), + this, TQT_SLOT( slotMessageReceived( Kopete::Message & ) ) ); + connect( m_chatService, TQT_SIGNAL( switchBoardClosed() ), + this, TQT_SLOT( slotSwitchBoardClosed() ) ); + connect( m_chatService, TQT_SIGNAL( receivedTypingMsg( const TQString &, bool ) ), + this, TQT_SLOT( receivedTypingMsg( const TQString &, bool ) ) ); KConfig *config = KGlobal::config(); config->setGroup( "MSN" ); if(config->readBoolEntry( "SendTypingNotification" , true) ) { - connect( this, SIGNAL( myselfTyping( bool ) ), - m_chatService, SLOT( sendTypingMsg( bool ) ) ); + connect( this, TQT_SIGNAL( myselfTyping( bool ) ), + m_chatService, TQT_SLOT( sendTypingMsg( bool ) ) ); } - connect( m_chatService, SIGNAL( msgAcknowledgement(unsigned int, bool) ), - this, SLOT( slotAcknowledgement(unsigned int, bool) ) ); - connect( m_chatService, SIGNAL( invitation( const QString&, const QString& ) ), - this, SLOT( slotInvitation( const QString&, const QString& ) ) ); - connect( m_chatService, SIGNAL( nudgeReceived(const QString&) ), - this, SLOT( slotNudgeReceived(const QString&) ) ); - connect( m_chatService, SIGNAL( errorMessage(int, const QString& ) ), static_cast(myself()->account()), SLOT( slotErrorMessageReceived(int, const QString& ) ) ); + connect( m_chatService, TQT_SIGNAL( msgAcknowledgement(unsigned int, bool) ), + this, TQT_SLOT( slotAcknowledgement(unsigned int, bool) ) ); + connect( m_chatService, TQT_SIGNAL( invitation( const TQString&, const TQString& ) ), + this, TQT_SLOT( slotInvitation( const TQString&, const TQString& ) ) ); + connect( m_chatService, TQT_SIGNAL( nudgeReceived(const TQString&) ), + this, TQT_SLOT( slotNudgeReceived(const TQString&) ) ); + connect( m_chatService, TQT_SIGNAL( errorMessage(int, const TQString& ) ), static_cast(myself()->account()), TQT_SLOT( slotErrorMessageReceived(int, const TQString& ) ) ); if(!m_timeoutTimer) { - m_timeoutTimer=new QTimer(this); - connect( m_timeoutTimer , SIGNAL(timeout()), this , SLOT(slotConnectionTimeout() ) ); + m_timeoutTimer=new TQTimer(this); + connect( m_timeoutTimer , TQT_SIGNAL(timeout()), this , TQT_SLOT(slotConnectionTimeout() ) ); } m_timeoutTimer->start(20000,true); } -void MSNChatSession::slotUserJoined( const QString &handle, const QString &publicName, bool IRO ) +void MSNChatSession::slotUserJoined( const TQString &handle, const TQString &publicName, bool IRO ) { delete m_timeoutTimer; m_timeoutTimer=0L; if( !account()->contacts()[ handle ] ) - account()->addContact( handle, QString::null, 0L, Kopete::Account::Temporary); + account()->addContact( handle, TQString::null, 0L, Kopete::Account::Temporary); MSNContact *c = static_cast( account()->contacts()[ handle ] ); @@ -229,7 +229,7 @@ void MSNChatSession::slotUserJoined( const QString &handle, const QString &publi slotRequestPicture(); } -void MSNChatSession::slotUserLeft( const QString &handle, const QString& reason ) +void MSNChatSession::slotUserLeft( const TQString &handle, const TQString& reason ) { MSNContact *c = static_cast( myself()->account()->contacts()[ handle ] ); if(c) @@ -274,7 +274,7 @@ void MSNChatSession::slotMessageSent(Kopete::Message &message,Kopete::ChatSessio else { m_messagesSent.insert( id, message ); - message.setBg(QColor()); // clear the bgColor + message.setBg(TQColor()); // clear the bgColor message.setBody(message.plainBody() , Kopete::Message::PlainText ); //clear every custom tag which are not sent appendMessage(message); // send the own msg to chat window } @@ -294,8 +294,8 @@ void MSNChatSession::slotMessageReceived( Kopete::Message &msg ) if( msg.plainBody().startsWith( "AutoMessage: " ) ) { //FIXME: HardCodded color are not so good - msg.setFg( QColor( "SlateGray3" ) ); - QFont f; + msg.setFg( TQColor( "SlateGray3" ) ); + TQFont f; f.setItalic( true ); msg.setFont( f ); } @@ -313,18 +313,18 @@ void MSNChatSession::slotActionInviteAboutToShow() m_actionInvite->popupMenu()->clear(); - QDictIterator it( account()->contacts() ); + TQDictIterator it( account()->contacts() ); for( ; it.current(); ++it ) { if( !members().contains( it.current() ) && it.current()->isOnline() && it.current() != myself() ) { KAction *a=new KopeteContactAction( it.current(), this, - SLOT( slotInviteContact( Kopete::Contact * ) ), m_actionInvite ); + TQT_SLOT( slotInviteContact( Kopete::Contact * ) ), m_actionInvite ); m_actionInvite->insert( a ); m_inviteactions.append( a ) ; } } - KAction *b=new KAction( i18n ("Other..."), 0, this, SLOT( slotInviteOtherContact() ), m_actionInvite, "actionOther" ); + KAction *b=new KAction( i18n ("Other..."), 0, this, TQT_SLOT( slotInviteOtherContact() ), m_actionInvite, "actionOther" ); m_actionInvite->insert( b ); m_inviteactions.append( b ) ; } @@ -342,7 +342,7 @@ void MSNChatSession::slotInviteContact( Kopete::Contact *contact ) inviteContact( contact->contactId() ); } -void MSNChatSession::inviteContact(const QString &contactId) +void MSNChatSession::inviteContact(const TQString &contactId) { if( m_chatService ) m_chatService->slotInviteContact( contactId ); @@ -353,9 +353,9 @@ void MSNChatSession::inviteContact(const QString &contactId) void MSNChatSession::slotInviteOtherContact() { bool ok; - QString handle = KInputDialog::getText(i18n( "MSN Plugin" ), + TQString handle = KInputDialog::getText(i18n( "MSN Plugin" ), i18n( "Please enter the email address of the person you want to invite:" ), - QString::null, &ok ); + TQString::null, &ok ); if( !ok ) return; @@ -378,7 +378,7 @@ void MSNChatSession::sendMessageQueue() return; } // kdDebug(14140) << "MSNChatSession::sendMessageQueue: " << m_messagesQueue.count() <::iterator it = m_messagesQueue.begin(); it!=m_messagesQueue.end(); it = m_messagesQueue.begin() ) + for ( TQValueList::iterator it = m_messagesQueue.begin(); it!=m_messagesQueue.end(); it = m_messagesQueue.begin() ) { //m_chatService->sendMsg( *it) ; slotMessageSent(*it , this); @@ -386,7 +386,7 @@ void MSNChatSession::sendMessageQueue() } - QMap::Iterator it; + TQMap::Iterator it; for( it = m_invitations.begin(); it != m_invitations.end() ; ++it) { if(! (*it)->incoming() && (*it)->state()( myself()->account()->contacts()[ handle ] ); if(!c) return; - QRegExp rx("Invitation-Cookie: ([0-9]*)"); + TQRegExp rx("Invitation-Cookie: ([0-9]*)"); rx.search(msg); long unsigned int cookie=rx.cap(1).toUInt(); @@ -443,7 +443,7 @@ void MSNChatSession::slotInvitation(const QString &handle, const QString &msg) if( msg.contains(MSNFileTransferSocket::applicationID()) ) { MSNFileTransferSocket *MFTS=new MSNFileTransferSocket(myself()->account()->accountId(),c,true,this); - connect(MFTS, SIGNAL( done(MSNInvitation*) ) , this , SLOT( invitationDone(MSNInvitation*) )); + connect(MFTS, TQT_SIGNAL( done(MSNInvitation*) ) , this , TQT_SLOT( invitationDone(MSNInvitation*) )); m_invitations.insert( cookie , MFTS); MFTS->parseInvitation(msg); setCanBeDeleted(false); @@ -460,11 +460,11 @@ void MSNChatSession::slotInvitation(const QString &handle, const QString &msg) } else { - rx=QRegExp("Application-Name: ([^\\r\\n]*)"); + rx=TQRegExp("Application-Name: ([^\\r\\n]*)"); rx.search(msg); - QString inviteName = rx.cap( 1 ); + TQString inviteName = rx.cap( 1 ); - QString body = i18n( + TQString body = i18n( "%1 has sent an unimplemented invitation, the invitation was rejected.\n" "The invitation was: %2" ) .arg( c->property( Kopete::Global::Properties::self()->nickName()).value().toString(), inviteName ); @@ -487,7 +487,7 @@ void MSNChatSession::invitationDone(MSNInvitation* MFTS) setCanBeDeleted(true); } -void MSNChatSession::sendFile(const QString &fileLocation, const QString &/*fileName*/, +void MSNChatSession::sendFile(const TQString &fileLocation, const TQString &/*fileName*/, long unsigned int fileSize) { // TODO create a switchboard to send the file is one is not available. @@ -499,7 +499,7 @@ void MSNChatSession::sendFile(const QString &fileLocation, const QString &/*file void MSNChatSession::initInvitation(MSNInvitation* invitation) { - connect(invitation->object(), SIGNAL( done(MSNInvitation*) ) , this , SLOT( invitationDone(MSNInvitation*) )); + connect(invitation->object(), TQT_SIGNAL( done(MSNInvitation*) ) , this , TQT_SLOT( invitationDone(MSNInvitation*) )); m_invitations.insert( invitation->cookie() , invitation); if(m_chatService) @@ -515,7 +515,7 @@ void MSNChatSession::initInvitation(MSNInvitation* invitation) void MSNChatSession::slotRequestPicture() { - QPtrList mb=members(); + TQPtrList mb=members(); MSNContact *c = static_cast( mb.first() ); if(!c) return; @@ -539,7 +539,7 @@ void MSNChatSession::slotRequestPicture() void MSNChatSession::slotDisplayPictureChanged() { - QPtrList mb=members(); + TQPtrList mb=members(); MSNContact *c = static_cast( mb.first() ); if ( c && m_image ) { @@ -552,9 +552,9 @@ void MSNChatSession::slotDisplayPictureChanged() if(w) { //We connected that in the constructor. we don't need to keep this slot active. - disconnect( Kopete::ChatSessionManager::self() , SIGNAL(viewActivated(KopeteView* )) , this, SLOT(slotDisplayPictureChanged()) ); + disconnect( Kopete::ChatSessionManager::self() , TQT_SIGNAL(viewActivated(KopeteView* )) , this, TQT_SLOT(slotDisplayPictureChanged()) ); - QPtrListIterator it=w->toolBarIterator() ; + TQPtrListIterator it=w->toolBarIterator() ; KAction *imgAction=actionCollection()->action("msnDisplayPicture"); if(imgAction) while(it) { @@ -563,15 +563,15 @@ void MSNChatSession::slotDisplayPictureChanged() { sz=tb->iconSize(); //ipdate if the size of the toolbar change. - disconnect(tb, SIGNAL(modechange()), this, SLOT(slotDisplayPictureChanged())); - connect(tb, SIGNAL(modechange()), this, SLOT(slotDisplayPictureChanged())); + disconnect(tb, TQT_SIGNAL(modechange()), this, TQT_SLOT(slotDisplayPictureChanged())); + connect(tb, TQT_SIGNAL(modechange()), this, TQT_SLOT(slotDisplayPictureChanged())); break; } ++it; } } - QString imgURL=c->property(Kopete::Global::Properties::self()->photo()).value().toString(); - QImage scaledImg = QPixmap( imgURL ).convertToImage().smoothScale( sz, sz ); + TQString imgURL=c->property(Kopete::Global::Properties::self()->photo()).value().toString(); + TQImage scaledImg = TQPixmap( imgURL ).convertToImage().smoothScale( sz, sz ); if(!scaledImg.isNull()) m_image->setPixmap( scaledImg ); else @@ -579,7 +579,7 @@ void MSNChatSession::slotDisplayPictureChanged() c->removeProperty(Kopete::Global::Properties::self()->photo()); //slotDisplayPictureChanged(); //don't do that or we might end in a infinite loop } - QToolTip::add( m_image, "" ); + TQToolTip::add( m_image, "" ); } else @@ -600,7 +600,7 @@ void MSNChatSession::slotDebugRawCommand() MSNDebugRawCmdDlg *dlg = new MSNDebugRawCmdDlg( 0L ); int result = dlg->exec(); - if( result == QDialog::Accepted && m_chatService ) + if( result == TQDialog::Accepted && m_chatService ) { m_chatService->sendCommand( dlg->command(), dlg->params(), dlg->addId(), dlg->msg().replace("\n","\r\n").utf8() ); @@ -610,7 +610,7 @@ void MSNChatSession::slotDebugRawCommand() } -void MSNChatSession::receivedTypingMsg( const QString &contactId, bool b ) +void MSNChatSession::receivedTypingMsg( const TQString &contactId, bool b ) { MSNContact *c = dynamic_cast( account()->contacts()[ contactId ] ); if(c && m_newSession && !view(false)) @@ -621,7 +621,7 @@ void MSNChatSession::receivedTypingMsg( const QString &contactId, bool b ) if ( notifyNewChat ) { // this internal message should open the window if they not exist - QString body = i18n( "%1 has started a chat with you" ).arg( c->metaContact()->displayName() ); + TQString body = i18n( "%1 has started a chat with you" ).arg( c->metaContact()->displayName() ); Kopete::Message tmpMsg = Kopete::Message( c, members(), body, Kopete::Message::Internal, Kopete::Message::PlainText ); appendMessage( tmpMsg ); } @@ -637,20 +637,20 @@ void MSNChatSession::slotSendNudge() { m_chatService->sendNudge(); Kopete::Message msg = Kopete::Message( myself(), members() , i18n ( "has sent a nudge" ), Kopete::Message::Outbound, - Kopete::Message::PlainText, QString(), Kopete::Message::TypeAction ); + Kopete::Message::PlainText, TQString(), Kopete::Message::TypeAction ); appendMessage( msg ); } } -void MSNChatSession::slotNudgeReceived(const QString& handle) +void MSNChatSession::slotNudgeReceived(const TQString& handle) { Kopete::Contact *c = account()->contacts()[ handle ] ; if(!c) c=members().getFirst(); Kopete::Message msg = Kopete::Message(c, myself(), i18n ( "has sent you a nudge" ), Kopete::Message::Inbound, - Kopete::Message::PlainText, QString(), Kopete::Message::TypeAction ); + Kopete::Message::PlainText, TQString(), Kopete::Message::TypeAction ); appendMessage( msg ); // Emit the nudge/buzz notification (configured by user). emitNudgeNotification(); @@ -681,25 +681,25 @@ void MSNChatSession::slotWebcamSend() void MSNChatSession::slotSendFile() { - QPtrListcontacts = members(); + TQPtrListcontacts = members(); static_cast(contacts.first())->sendFile(); } void MSNChatSession::startChatSession() { - QPtrList mb=members(); + TQPtrList mb=members(); static_cast( account() )->slotStartChatSession( mb.first()->contactId() ); if(!m_timeoutTimer) { - m_timeoutTimer=new QTimer(this); - connect( m_timeoutTimer , SIGNAL(timeout()), this , SLOT(slotConnectionTimeout() ) ); + m_timeoutTimer=new TQTimer(this); + connect( m_timeoutTimer , TQT_SIGNAL(timeout()), this , TQT_SLOT(slotConnectionTimeout() ) ); } m_timeoutTimer->start(20000, true); } -void MSNChatSession::cleanMessageQueue( const QString & reason ) +void MSNChatSession::cleanMessageQueue( const TQString & reason ) { delete m_timeoutTimer; m_timeoutTimer=0L; @@ -715,21 +715,21 @@ void MSNChatSession::cleanMessageQueue( const QString & reason ) else m=m_messagesSent.begin().data(); - QString body=i18n("The following message has not been sent correctly (%1): \n%2").arg(reason, m.plainBody()); + TQString body=i18n("The following message has not been sent correctly (%1): \n%2").arg(reason, m.plainBody()); Kopete::Message msg = Kopete::Message(m.to().first() , members() , body , Kopete::Message::Internal, Kopete::Message::PlainText); appendMessage(msg); } else { Kopete::Message m; - QString body=i18n("These messages have not been sent correctly (%1):
    ").arg(reason); - for ( QMap::iterator it = m_messagesSent.begin(); it!=m_messagesSent.end(); it = m_messagesSent.begin() ) + TQString body=i18n("These messages have not been sent correctly (%1):
      ").arg(reason); + for ( TQMap::iterator it = m_messagesSent.begin(); it!=m_messagesSent.end(); it = m_messagesSent.begin() ) { m=it.data(); body+= "
    • "+m.escapedBody()+"
    • "; m_messagesSent.remove(it); } - for ( QValueList::iterator it = m_messagesQueue.begin(); it!=m_messagesQueue.end(); it = m_messagesQueue.begin() ) + for ( TQValueList::iterator it = m_messagesQueue.begin(); it!=m_messagesQueue.end(); it = m_messagesQueue.begin() ) { m=(*it); body+= "
    • "+m.escapedBody()+"
    • "; diff --git a/kopete/protocols/msn/msnchatsession.h b/kopete/protocols/msn/msnchatsession.h index 8011574e..702fac8a 100644 --- a/kopete/protocols/msn/msnchatsession.h +++ b/kopete/protocols/msn/msnchatsession.h @@ -39,11 +39,11 @@ public: MSNChatSession( Kopete::Protocol *protocol, const Kopete::Contact *user, Kopete::ContactPtrList others, const char *name = 0 ); ~MSNChatSession(); - void createChat( const QString &handle, const QString &address, const QString &auth, const QString &ID = QString::null ); + void createChat( const TQString &handle, const TQString &address, const TQString &auth, const TQString &ID = TQString::null ); MSNSwitchBoardSocket *service() { return m_chatService; }; - void sendFile( const QString &fileLocation, const QString &fileName, + void sendFile( const TQString &fileLocation, const TQString &fileName, long unsigned int fileSize ); /** @@ -51,7 +51,7 @@ public: */ void initInvitation(MSNInvitation* invitation); - virtual void inviteContact(const QString& ); + virtual void inviteContact(const TQString& ); public slots: void slotCloseSession(); @@ -65,7 +65,7 @@ public slots: * this is a reimplementation of ChatSesstion slot. * the original slot is not virtual, but that's not a problem because it's a slot. */ - virtual void receivedTypingMsg( const QString &, bool ); + virtual void receivedTypingMsg( const TQString &, bool ); void slotConnectionTimeout(); @@ -73,12 +73,12 @@ private slots: void slotMessageSent( Kopete::Message &message, Kopete::ChatSession *kmm ); void slotMessageReceived( Kopete::Message &message ); - void slotUserJoined( const QString &handle, const QString &publicName, bool IRO ); - void slotUserLeft( const QString &handle, const QString &reason ); + void slotUserJoined( const TQString &handle, const TQString &publicName, bool IRO ); + void slotUserLeft( const TQString &handle, const TQString &reason ); void slotSwitchBoardClosed(); void slotInviteContact( Kopete::Contact *contact ); void slotAcknowledgement( unsigned int id, bool ack ); - void slotInvitation( const QString &handle, const QString &msg ); + void slotInvitation( const TQString &handle, const TQString &msg ); void slotActionInviteAboutToShow(); @@ -94,27 +94,27 @@ private slots: void slotWebcamSend(); void slotSendFile(); - void slotNudgeReceived(const QString& handle); + void slotNudgeReceived(const TQString& handle); private: MSNSwitchBoardSocket *m_chatService; - QString otherString; + TQString otherString; KActionMenu *m_actionInvite; - QPtrList m_inviteactions; + TQPtrList m_inviteactions; KAction *m_actionNudge; KAction *m_actionWebcamReceive; KAction *m_actionWebcamSend; //Messages sent before the ending of the connection are queued - QValueList m_messagesQueue; + TQValueList m_messagesQueue; void sendMessageQueue(); - void cleanMessageQueue( const QString &reason); + void cleanMessageQueue( const TQString &reason); void startChatSession(); - QMap m_messagesSent; + TQMap m_messagesSent; - QMap m_invitations; + TQMap m_invitations; /** @@ -122,8 +122,8 @@ private: */ bool m_newSession; - QLabel *m_image; - QTimer *m_timeoutTimer; + TQLabel *m_image; + TQTimer *m_timeoutTimer; uint m_connectionTry; @@ -131,7 +131,7 @@ signals: /* * This signal is relayed to the protocol and after, to plugins */ - void invitation(MSNInvitation*& invitation, const QString &bodyMSG , long unsigned int cookie , MSNChatSession* msnMM , MSNContact* c ); + void invitation(MSNInvitation*& invitation, const TQString &bodyMSG , long unsigned int cookie , MSNChatSession* msnMM , MSNContact* c ); }; #endif diff --git a/kopete/protocols/msn/msncontact.cpp b/kopete/protocols/msn/msncontact.cpp index 8a490a1b..c6ef14f8 100644 --- a/kopete/protocols/msn/msncontact.cpp +++ b/kopete/protocols/msn/msncontact.cpp @@ -21,7 +21,7 @@ #include "msncontact.h" -#include +#include #undef KDE_NO_COMPAT #include @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include "kopetecontactlist.h" @@ -50,7 +50,7 @@ #include "msnnotifysocket.h" #include "msnaccount.h" -MSNContact::MSNContact( Kopete::Account *account, const QString &id, Kopete::MetaContact *parent ) +MSNContact::MSNContact( Kopete::Account *account, const TQString &id, Kopete::MetaContact *parent ) : Kopete::Contact( account, id, parent ) { m_deleted = false; @@ -125,30 +125,30 @@ Kopete::ChatSession *MSNContact::manager( Kopete::Contact::CanCreateFlags canCre return manager; } -QPtrList *MSNContact::customContextMenuActions() +TQPtrList *MSNContact::customContextMenuActions() { - QPtrList *m_actionCollection = new QPtrList; + TQPtrList *m_actionCollection = new TQPtrList; // Block/unblock Contact - QString label = isBlocked() ? i18n( "Unblock User" ) : i18n( "Block User" ); + TQString label = isBlocked() ? i18n( "Unblock User" ) : i18n( "Block User" ); if( !actionBlock ) { - actionBlock = new KAction( label, "msn_blocked",0, this, SLOT( slotBlockUser() ), + actionBlock = new KAction( label, "msn_blocked",0, this, TQT_SLOT( slotBlockUser() ), this, "actionBlock" ); //show profile - actionShowProfile = new KAction( i18n("Show Profile") , 0, this, SLOT( slotShowProfile() ), + actionShowProfile = new KAction( i18n("Show Profile") , 0, this, TQT_SLOT( slotShowProfile() ), this, "actionShowProfile" ); // Send mail (only available if it is an hotmail account) - actionSendMail = new KAction( i18n("Send Email...") , "mail_generic",0, this, SLOT( slotSendMail() ), + actionSendMail = new KAction( i18n("Send Email...") , "mail_generic",0, this, TQT_SLOT( slotSendMail() ), this, "actionSendMail" ); // Invite to receive webcam - actionWebcamReceive = new KAction( i18n( "View Contact's Webcam" ), "webcamreceive", 0, this, SLOT(slotWebcamReceive() ), this, "msnWebcamReceive" ) ; + actionWebcamReceive = new KAction( i18n( "View Contact's Webcam" ), "webcamreceive", 0, this, TQT_SLOT(slotWebcamReceive() ), this, "msnWebcamReceive" ) ; //Send webcam action - actionWebcamSend = new KAction( i18n( "Send Webcam" ), "webcamsend", 0, this, SLOT(slotWebcamSend() ), this, "msnWebcamSend" ) ; + actionWebcamSend = new KAction( i18n( "Send Webcam" ), "webcamsend", 0, this, TQT_SLOT(slotWebcamSend() ), this, "msnWebcamSend" ) ; } else actionBlock->setText( label ); @@ -178,22 +178,22 @@ void MSNContact::slotBlockUser() if( m_blocked ) { - notify->removeContact( contactId(), MSNProtocol::BL, QString::null, QString::null ); + notify->removeContact( contactId(), MSNProtocol::BL, TQString::null, TQString::null ); } else { if(m_allowed) - notify->removeContact( contactId(), MSNProtocol::AL, QString::null, QString::null ); + notify->removeContact( contactId(), MSNProtocol::AL, TQString::null, TQString::null ); else - notify->addContact( contactId(), MSNProtocol::BL, QString::null, QString::null, QString::null ); + notify->addContact( contactId(), MSNProtocol::BL, TQString::null, TQString::null, TQString::null ); } } void MSNContact::slotUserInfo() { - KDialogBase *infoDialog=new KDialogBase( 0l, "infoDialog", /*modal = */false, QString::null, KDialogBase::Close , KDialogBase::Close, false ); - QString nick=property( Kopete::Global::Properties::self()->nickName()).value().toString(); - QString personalMessage=property( MSNProtocol::protocol()->propPersonalMessage).value().toString(); + KDialogBase *infoDialog=new KDialogBase( 0l, "infoDialog", /*modal = */false, TQString::null, KDialogBase::Close , KDialogBase::Close, false ); + TQString nick=property( Kopete::Global::Properties::self()->nickName()).value().toString(); + TQString personalMessage=property( MSNProtocol::protocol()->propPersonalMessage).value().toString(); MSNInfo *info=new MSNInfo ( infoDialog,"info"); info->m_id->setText( contactId() ); info->m_displayName->setText(nick); @@ -203,7 +203,7 @@ void MSNContact::slotUserInfo() info->m_phm->setText(m_phoneMobile); info->m_reversed->setChecked(m_reversed); - connect( info->m_reversed, SIGNAL(toggled(bool)) , this, SLOT(slotUserInfoDialogReversedToggled())); + connect( info->m_reversed, TQT_SIGNAL(toggled(bool)) , this, TQT_SLOT(slotUserInfoDialogReversedToggled())); infoDialog->setMainWidget(info); infoDialog->setCaption(nick); @@ -213,9 +213,9 @@ void MSNContact::slotUserInfo() void MSNContact::slotUserInfoDialogReversedToggled() { //workaround to make this checkboxe readonly - const QCheckBox *cb=dynamic_cast(sender()); + const TQCheckBox *cb=dynamic_cast(sender()); if(cb && cb->isChecked()!=m_reversed) - const_cast(cb)->setChecked(m_reversed); + const_cast(cb)->setChecked(m_reversed); } void MSNContact::deleteContact() @@ -228,7 +228,7 @@ void MSNContact::deleteContact() if( hasProperty(MSNProtocol::protocol()->propGuid.key()) ) { // Remove from all groups he belongs (if applicable) - for( QMap::Iterator it = m_serverGroups.begin(); it != m_serverGroups.end(); ++it ) + for( TQMap::Iterator it = m_serverGroups.begin(); it != m_serverGroups.end(); ++it ) { kdDebug(14140) << k_funcinfo << "Removing contact from group \"" << it.key() << "\"" << endl; notify->removeContact( contactId(), MSNProtocol::FL, guid(), it.key() ); @@ -237,7 +237,7 @@ void MSNContact::deleteContact() // Then trully remove it from server contact list, // because only removing the contact from his groups isn't sufficent from MSNP11. kdDebug( 14140 ) << k_funcinfo << "Removing contact from top-level." << endl; - notify->removeContact( contactId(), MSNProtocol::FL, guid(), QString::null); + notify->removeContact( contactId(), MSNProtocol::FL, guid(), TQString::null); } else { @@ -325,7 +325,7 @@ void MSNContact::setClientFlags( uint flags ) m_clientFlags=flags; } -void MSNContact::setInfo(const QString &type,const QString &data ) +void MSNContact::setInfo(const TQString &type,const TQString &data ) { if( type == "PHH" ) { @@ -362,12 +362,12 @@ void MSNContact::setInfo(const QString &type,const QString &data ) } -void MSNContact::serialize( QMap &serializedData, QMap & /* addressBookData */ ) +void MSNContact::serialize( TQMap &serializedData, TQMap & /* addressBookData */ ) { // Contact id and display name are already set for us, only add the rest - QString groups; + TQString groups; bool firstEntry = true; - for( QMap::ConstIterator it = m_serverGroups.begin(); it != m_serverGroups.end(); ++it ) + for( TQMap::ConstIterator it = m_serverGroups.begin(); it != m_serverGroups.end(); ++it ) { if( !firstEntry ) { @@ -377,7 +377,7 @@ void MSNContact::serialize( QMap &serializedData, QMap &serializedData, QMappropGuid).value().toString(); } +TQString MSNContact::guid(){ return property(MSNProtocol::protocol()->propGuid).value().toString(); } -QString MSNContact::phoneHome(){ return m_phoneHome ;} -QString MSNContact::phoneWork(){ return m_phoneWork ;} -QString MSNContact::phoneMobile(){ return m_phoneMobile ;} +TQString MSNContact::phoneHome(){ return m_phoneHome ;} +TQString MSNContact::phoneWork(){ return m_phoneWork ;} +TQString MSNContact::phoneMobile(){ return m_phoneMobile ;} -const QMap MSNContact::serverGroups() const +const TQMap MSNContact::serverGroups() const { return m_serverGroups; } @@ -451,21 +451,21 @@ void MSNContact::sync( unsigned int changed ) return; //STEP ONE : add the contact to every kopetegroups where the MC is - QPtrList groupList = metaContact()->groups(); + TQPtrList groupList = metaContact()->groups(); for ( Kopete::Group *group = groupList.first(); group; group = groupList.next() ) { //For each group, ensure it is on the MSN server if( !group->pluginData( protocol() , account()->accountId() + " id" ).isEmpty() ) { - QString Gid=group->pluginData( protocol(), account()->accountId() + " id" ); + TQString Gid=group->pluginData( protocol(), account()->accountId() + " id" ); if( !static_cast( account() )->m_groupList.contains(Gid) ) { // ohoh! something is corrupted on the contactlist.xml // anyway, we never should add a contact to an unexisting group on the server. // This shouln't be possible anymore 2004-06-10 -Olivier //repair the problem - group->setPluginData( protocol() , account()->accountId() + " id" , QString::null); - group->setPluginData( protocol() , account()->accountId() + " displayName" , QString::null); + group->setPluginData( protocol() , account()->accountId() + " id" , TQString::null); + group->setPluginData( protocol() , account()->accountId() + " displayName" , TQString::null); kdWarning( 14140 ) << k_funcinfo << " Group " << group->displayName() << " marked with id #" <displayName().isEmpty() && group->type() == Kopete::Group::Normal) //not the top-level @@ -479,7 +479,7 @@ void MSNContact::sync( unsigned int changed ) else if( !m_serverGroups.contains(Gid) ) { //Add the contact to the group on the server - notify->addContact( contactId(), MSNProtocol::FL, QString::null, guid(), Gid ); + notify->addContact( contactId(), MSNProtocol::FL, TQString::null, guid(), Gid ); count++; m_moving=true; } @@ -502,9 +502,9 @@ void MSNContact::sync( unsigned int changed ) //STEP TWO : remove the contact from groups where the MC is not, but let it at least in one group //contact is not in that group. on the server. we will remove them dirrectly after the loop - QValueList removinglist; + TQValueList removinglist; - for( QMap::Iterator it = m_serverGroups.begin();(count > 1 && it != m_serverGroups.end()); ++it ) + for( TQMap::Iterator it = m_serverGroups.begin();(count > 1 && it != m_serverGroups.end()); ++it ) { if( !static_cast( account() )->m_groupList.contains(it.key()) ) { // ohoh! something is corrupted on the contactlist.xml @@ -531,7 +531,7 @@ void MSNContact::sync( unsigned int changed ) } } - for(QValueList::Iterator it= removinglist.begin() ; it != removinglist.end() ; ++it ) + for(TQValueList::Iterator it= removinglist.begin() ; it != removinglist.end() ; ++it ) contactRemovedFromGroup(*it); //FINAL TEST: is the contact at least in a group.. @@ -539,17 +539,17 @@ void MSNContact::sync( unsigned int changed ) // we add the contact to the group #0 (the default one) /*if(count==0) { -// notify->addContact( contactId(), MSNProtocol::FL, QString::null, guid(), "0"); +// notify->addContact( contactId(), MSNProtocol::FL, TQString::null, guid(), "0"); }*/ } -void MSNContact::contactAddedToGroup( const QString& groupId, Kopete::Group *group ) +void MSNContact::contactAddedToGroup( const TQString& groupId, Kopete::Group *group ) { m_serverGroups.insert( groupId, group ); m_moving=false; } -void MSNContact::contactRemovedFromGroup( const QString& groupId ) +void MSNContact::contactRemovedFromGroup( const TQString& groupId ) { m_serverGroups.remove( groupId ); if(m_serverGroups.isEmpty() && !m_moving) @@ -560,7 +560,7 @@ void MSNContact::contactRemovedFromGroup( const QString& groupId ) } -void MSNContact::rename( const QString &newName ) +void MSNContact::rename( const TQString &newName ) { //kdDebug( 14140 ) << k_funcinfo << "From: " << displayName() << ", to: " << newName << endl; @@ -577,20 +577,20 @@ void MSNContact::rename( const QString &newName ) void MSNContact::slotShowProfile() { - KRun::runURL( KURL( QString::fromLatin1("http://members.msn.com/?pgmarket=it-it&mem=") + contactId()) , "text/html" ); + KRun::runURL( KURL( TQString::fromLatin1("http://members.msn.com/?pgmarket=it-it&mem=") + contactId()) , "text/html" ); } /** * FIXME: Make this a standard KMM API call */ -void MSNContact::sendFile( const KURL &sourceURL, const QString &altFileName, uint /*fileSize*/ ) +void MSNContact::sendFile( const KURL &sourceURL, const TQString &altFileName, uint /*fileSize*/ ) { - QString filePath; + TQString filePath; //If the file location is null, then get it from a file open dialog if( !sourceURL.isValid() ) - filePath = KFileDialog::getOpenFileName( QString::null ,"*", 0l , i18n( "Kopete File Transfer" )); + filePath = KFileDialog::getOpenFileName( TQString::null ,"*", 0l , i18n( "Kopete File Transfer" )); else filePath = sourceURL.path(-1); @@ -598,7 +598,7 @@ void MSNContact::sendFile( const KURL &sourceURL, const QString &altFileName, ui if ( !filePath.isEmpty() ) { - Q_UINT32 fileSize = QFileInfo(filePath).size(); + Q_UINT32 fileSize = TQFileInfo(filePath).size(); //Send the file static_cast( manager(Kopete::Contact::CanCreate) )->sendFile( filePath, altFileName, fileSize ); @@ -614,7 +614,7 @@ void MSNContact::setOnlineStatus(const Kopete::OnlineStatus& status) (status.weight()==0) ? 0 : (status.weight() -1) , protocol() , status.internalStatus()+15 , - status.overlayIcons() + QStringList("msn_blocked") , + status.overlayIcons() + TQStringList("msn_blocked") , i18n("%1|Blocked").arg( status.description() ) ) ); } else if(!isBlocked() && status.internalStatus() >= 15) @@ -672,7 +672,7 @@ void MSNContact::setDisplayPicture(KTempFile *f) //copy the temp file somewere else. // in a better world, the file could be dirrectly wrote at the correct location. // but the custom emoticon code is to deeply merged in the display picture code while it could be separated. - QString newlocation=locateLocal( "appdata", "msnpictures/"+ contactId().lower().replace(QRegExp("[./~]"),"-") +".png" ) ; + TQString newlocation=locateLocal( "appdata", "msnpictures/"+ contactId().lower().replace(TQRegExp("[./~]"),"-") +".png" ) ; KIO::Job *j=KIO::file_move( KURL::fromPathOrURL( f->name() ) , KURL::fromPathOrURL( newlocation ) , -1, true /*overwrite*/ , false /*resume*/ , false /*showProgressInfo*/ ); @@ -680,17 +680,17 @@ void MSNContact::setDisplayPicture(KTempFile *f) delete f; //let the time to KIO to copy the file - connect(j, SIGNAL(result(KIO::Job *)) , this, SLOT(slotEmitDisplayPictureChanged() )); + connect(j, TQT_SIGNAL(result(KIO::Job *)) , this, TQT_SLOT(slotEmitDisplayPictureChanged() )); } void MSNContact::slotEmitDisplayPictureChanged() { - QString newlocation=locateLocal( "appdata", "msnpictures/"+ contactId().lower().replace(QRegExp("[./~]"),"-") +".png" ) ; + TQString newlocation=locateLocal( "appdata", "msnpictures/"+ contactId().lower().replace(TQRegExp("[./~]"),"-") +".png" ) ; setProperty( Kopete::Global::Properties::self()->photo() , newlocation ); emit displayPictureChanged(); } -void MSNContact::setObject(const QString &obj) +void MSNContact::setObject(const TQString &obj) { if(m_obj==obj && (obj.isEmpty() || hasProperty(Kopete::Global::Properties::self()->photo().key()))) return; diff --git a/kopete/protocols/msn/msncontact.h b/kopete/protocols/msn/msncontact.h index bcd6cc68..8b38d678 100644 --- a/kopete/protocols/msn/msncontact.h +++ b/kopete/protocols/msn/msncontact.h @@ -46,7 +46,7 @@ class MSNContact : public Kopete::Contact Q_OBJECT public: - MSNContact( Kopete::Account *account, const QString &id, Kopete::MetaContact *parent ); + MSNContact( Kopete::Account *account, const TQString &id, Kopete::MetaContact *parent ); ~MSNContact(); /** @@ -77,12 +77,12 @@ public: /** * set one phone number */ - void setInfo(const QString &type, const QString &data); + void setInfo(const TQString &type, const TQString &data); /** * The groups in which the user is located on the server. */ - const QMap serverGroups() const; + const TQMap serverGroups() const; /** * clear that map */ @@ -96,20 +96,20 @@ public: virtual bool isReachable(); - virtual QPtrList *customContextMenuActions(); + virtual TQPtrList *customContextMenuActions(); /** * update the server group map */ - void contactRemovedFromGroup( const QString& groupId ); - void contactAddedToGroup(const QString& groupId, Kopete::Group *group ); + void contactRemovedFromGroup( const TQString& groupId ); + void contactAddedToGroup(const TQString& groupId, Kopete::Group *group ); - virtual void serialize( QMap &serializedData, QMap &addressBookData ); + virtual void serialize( TQMap &serializedData, TQMap &addressBookData ); /** * Rename contact on server */ - virtual void rename( const QString &newName ) KDE_DEPRECATED; + virtual void rename( const TQString &newName ) KDE_DEPRECATED; /** * Returns the MSN Message Manager associated with this contact @@ -122,19 +122,19 @@ public: */ void setOnlineStatus(const Kopete::OnlineStatus&); - QString guid(); - QString phoneHome(); - QString phoneWork(); - QString phoneMobile(); + TQString guid(); + TQString phoneHome(); + TQString phoneWork(); + TQString phoneMobile(); - void setObject(const QString &obj); - QString object() const { return m_obj; } + void setObject(const TQString &obj); + TQString object() const { return m_obj; } public slots: virtual void slotUserInfo(); virtual void deleteContact(); virtual void sendFile( const KURL &sourceURL = KURL(), - const QString &fileName = QString::null, uint fileSize = 0L ); + const TQString &fileName = TQString::null, uint fileSize = 0L ); /** * Every time the kopete's contactlist is modified, we sync the serverlist with it @@ -159,7 +159,7 @@ private slots: void slotUserInfoDialogReversedToggled(); private: - QMap m_serverGroups; + TQMap m_serverGroups; bool m_blocked; bool m_allowed; @@ -170,9 +170,9 @@ private: uint m_clientFlags; - QString m_phoneHome; - QString m_phoneWork; - QString m_phoneMobile; + TQString m_phoneHome; + TQString m_phoneWork; + TQString m_phoneMobile; KAction *actionBlock; @@ -181,7 +181,7 @@ private: KAction *actionWebcamReceive; KAction *actionWebcamSend; - QString m_obj; //the MSNObject + TQString m_obj; //the MSNObject /** * keep the current status here. (it's normally already in Kopete::Contact::d->onlineStatus) diff --git a/kopete/protocols/msn/msndebugrawcmddlg.cpp b/kopete/protocols/msn/msndebugrawcmddlg.cpp index 341c6808..48c4050e 100644 --- a/kopete/protocols/msn/msndebugrawcmddlg.cpp +++ b/kopete/protocols/msn/msndebugrawcmddlg.cpp @@ -21,18 +21,18 @@ #include "ui/msndebugrawcommand_base.h" -#include -#include +#include +#include #include #include -MSNDebugRawCmdDlg::MSNDebugRawCmdDlg( QWidget *parent ) +MSNDebugRawCmdDlg::MSNDebugRawCmdDlg( TQWidget *parent ) : KDialogBase( parent, 0L, true, i18n( "DEBUG: Send Raw Command - MSN Plugin" ), Ok | Cancel, Ok, true ) { - setInitialSize( QSize( 350, 200 ) ); + setInitialSize( TQSize( 350, 200 ) ); m_main = new MSNDebugRawCommand_base( this ); setMainWidget( m_main ); @@ -42,12 +42,12 @@ MSNDebugRawCmdDlg::~MSNDebugRawCmdDlg() { } -QString MSNDebugRawCmdDlg::command() +TQString MSNDebugRawCmdDlg::command() { return m_main->m_command->text(); } -QString MSNDebugRawCmdDlg::params() +TQString MSNDebugRawCmdDlg::params() { return m_main->m_params->text(); } @@ -62,7 +62,7 @@ bool MSNDebugRawCmdDlg::addId() return m_main->m_addId->isChecked(); } -QString MSNDebugRawCmdDlg::msg() +TQString MSNDebugRawCmdDlg::msg() { return m_main->m_msg->text(); } diff --git a/kopete/protocols/msn/msndebugrawcmddlg.h b/kopete/protocols/msn/msndebugrawcmddlg.h index 3721daae..7f9741e8 100644 --- a/kopete/protocols/msn/msndebugrawcmddlg.h +++ b/kopete/protocols/msn/msndebugrawcmddlg.h @@ -34,14 +34,14 @@ class MSNDebugRawCmdDlg : public KDialogBase Q_OBJECT public: - MSNDebugRawCmdDlg( QWidget *parent ); + MSNDebugRawCmdDlg( TQWidget *parent ); ~MSNDebugRawCmdDlg(); - QString command(); - QString params(); + TQString command(); + TQString params(); bool addNewline(); bool addId(); - QString msg(); + TQString msg(); private: MSNDebugRawCommand_base *m_main; diff --git a/kopete/protocols/msn/msnfiletransfersocket.cpp b/kopete/protocols/msn/msnfiletransfersocket.cpp index 54a09e4a..c07fad06 100644 --- a/kopete/protocols/msn/msnfiletransfersocket.cpp +++ b/kopete/protocols/msn/msnfiletransfersocket.cpp @@ -21,7 +21,7 @@ #include //qt -#include +#include // kde #include @@ -40,7 +40,7 @@ using namespace KNetwork; -MSNFileTransferSocket::MSNFileTransferSocket(const QString &handle, Kopete::Contact *c,bool incoming, QObject* parent) +MSNFileTransferSocket::MSNFileTransferSocket(const TQString &handle, Kopete::Contact *c,bool incoming, TQObject* parent) : MSNSocket(parent) , MSNInvitation(incoming, MSNFileTransferSocket::applicationID() , i18n("File Transfer - MSN Plugin")) { m_handle=handle; @@ -50,8 +50,8 @@ MSNFileTransferSocket::MSNFileTransferSocket(const QString &handle, Kopete::Cont m_contact=c; ready=true; - QObject::connect( this, SIGNAL( socketClosed() ), this, SLOT( slotSocketClosed() ) ); - QObject::connect( this, SIGNAL( blockRead( const QByteArray & ) ), this, SLOT(slotReadBlock( const QByteArray & ) ) ); + TQObject::connect( this, TQT_SIGNAL( socketClosed() ), this, TQT_SLOT( slotSocketClosed() ) ); + TQObject::connect( this, TQT_SIGNAL( blockRead( const TQByteArray & ) ), this, TQT_SLOT(slotReadBlock( const TQByteArray & ) ) ); } MSNFileTransferSocket::~MSNFileTransferSocket() @@ -61,7 +61,7 @@ MSNFileTransferSocket::~MSNFileTransferSocket() kdDebug(14140) << "MSNFileTransferSocket::~MSNFileTransferSocket" <open( IO_WriteOnly )) sendCommand( "TFR" ,NULL,false); @@ -106,13 +106,13 @@ void MSNFileTransferSocket::parseCommand(const QString & cmd, uint id, const QSt disconnect(); } else - sendCommand("FIL" , QString::number(size()) , false); + sendCommand("FIL" , TQString::number(size()) , false); } else if( cmd == "TFR" ) { m_downsize=0; ready=true; - QTimer::singleShot( 0, this, SLOT(slotSendFile()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(slotSendFile()) ); } else if( cmd == "CCL" ) { @@ -131,12 +131,12 @@ void MSNFileTransferSocket::doneConnect() MSNSocket::doneConnect(); } -void MSNFileTransferSocket::bytesReceived(const QByteArray & head) +void MSNFileTransferSocket::bytesReceived(const TQByteArray & head) { if(head[0]!='\0') { kdDebug(14140) << "MSNFileTransferSocket::bytesReceived: transfer aborted" <writeBlock( block.data(), block.size() ); // write to file @@ -175,7 +175,7 @@ void MSNFileTransferSocket::slotReadBlock(const QByteArray &block) //the transfer seems to be finished. sendCommand( "BYE" ,"16777989",false); // if we are not already disconected in 30 seconds, do it. - QTimer::singleShot( 30000 , this, SLOT(disconnect() ) ); + TQTimer::singleShot( 30000 , this, TQT_SLOT(disconnect() ) ); } } @@ -185,8 +185,8 @@ void MSNFileTransferSocket::setKopeteTransfer(Kopete::Transfer *kt) m_kopeteTransfer=kt; if(kt) { - QObject::connect(kt , SIGNAL(transferCanceled()), this, SLOT(abort())); - QObject::connect(kt, SIGNAL(destroyed()) , this , SLOT(slotKopeteTransferDestroyed())); + TQObject::connect(kt , TQT_SIGNAL(transferCanceled()), this, TQT_SLOT(abort())); + TQObject::connect(kt, TQT_SIGNAL(destroyed()) , this , TQT_SLOT(slotKopeteTransferDestroyed())); } } @@ -194,13 +194,13 @@ void MSNFileTransferSocket::listen(int port) { m_server = new KServerSocket(); - QObject::connect( m_server, SIGNAL(readyAccept()), this, SLOT(slotAcceptConnection())); - m_server->setAddress(QString::number(port)); + TQObject::connect( m_server, TQT_SIGNAL(readyAccept()), this, TQT_SLOT(slotAcceptConnection())); + m_server->setAddress(TQString::number(port)); kdDebug(14140) << "MSNFileTransferSocket::listen: about to listen"<listen(1); kdDebug(14140) << "MSNFileTransferSocket::listen: result: "<< listenResult <open(IO_ReadOnly)) { //FIXME: abort transfer here @@ -286,7 +286,7 @@ void MSNFileTransferSocket::slotSendFile() { //the transfer seems to be finished. // if we are not already disconected in 30 seconds, do it. - QTimer::singleShot( 30000 , this, SLOT(disconnect() ) ); + TQTimer::singleShot( 30000 , this, TQT_SLOT(disconnect() ) ); return; } @@ -295,7 +295,7 @@ void MSNFileTransferSocket::slotSendFile() char data[2046]; int bytesRead = m_file->readBlock( data, 2045 ); - QByteArray block(bytesRead+3); + TQByteArray block(bytesRead+3); // char i1= (char)fmod( bytesRead, 256 ) ; // char i2= (char)floor( bytesRead / 256 ) ; // kdDebug(14140) << "MSNFileTransferSocket::slotSendFile: " << (int)i1 <<" + 256* "<< (int)i2 <<" = " << bytesRead <askIncomingTransfer( m_contact , filename, filesize, QString::null, QString::number( cookie() ) ); + Kopete::TransferManager::transferManager()->askIncomingTransfer( m_contact , filename, filesize, TQString::null, TQString::number( cookie() ) ); - QObject::connect( Kopete::TransferManager::transferManager(), SIGNAL( accepted( Kopete::Transfer *, const QString& ) ),this, SLOT( slotFileTransferAccepted( Kopete::Transfer *, const QString& ) ) ); - QObject::connect( Kopete::TransferManager::transferManager(), SIGNAL( refused( const Kopete::FileTransferInfo & ) ), this, SLOT( slotFileTransferRefused( const Kopete::FileTransferInfo & ) ) ); + TQObject::connect( Kopete::TransferManager::transferManager(), TQT_SIGNAL( accepted( Kopete::Transfer *, const TQString& ) ),this, TQT_SLOT( slotFileTransferAccepted( Kopete::Transfer *, const TQString& ) ) ); + TQObject::connect( Kopete::TransferManager::transferManager(), TQT_SIGNAL( refused( const Kopete::FileTransferInfo & ) ), this, TQT_SLOT( slotFileTransferRefused( const Kopete::FileTransferInfo & ) ) ); } else if( msg.contains("Invitation-Command: ACCEPT") ) { if(incoming()) { - rx=QRegExp("IP-Address: ([0-9\\.]*)"); + rx=TQRegExp("IP-Address: ([0-9\\.]*)"); rx.search(msg); - QString ip_address = rx.cap(1); - rx=QRegExp("AuthCookie: ([0-9]*)"); + TQString ip_address = rx.cap(1); + rx=TQRegExp("AuthCookie: ([0-9]*)"); rx.search(msg); - QString authcook = rx.cap(1); - rx=QRegExp("Port: ([0-9]*)"); + TQString authcook = rx.cap(1); + rx=TQRegExp("Port: ([0-9]*)"); rx.search(msg); - QString port = rx.cap(1); + TQString port = rx.cap(1); setAuthCookie(authcook); connect(ip_address, port.toUInt()); @@ -377,7 +377,7 @@ void MSNFileTransferSocket::parseInvitation(const QString& msg) else { unsigned long int auth = (rand()%(999999))+1; - setAuthCookie(QString::number(auth)); + setAuthCookie(TQString::number(auth)); setKopeteTransfer(Kopete::TransferManager::transferManager()->addTransfer(m_contact, fileName(), size(), m_contact->metaContact() ? m_contact->metaContact()->displayName() : m_contact->contactId() , Kopete::FileTransferInfo::Outgoing)); @@ -387,15 +387,15 @@ void MSNFileTransferSocket::parseInvitation(const QString& msg) MSNNotifySocket *notify=static_cast(manager->account())->notifySocket(); if(notify){ - QCString message=QString( + TQCString message=TQString( "MIME-Version: 1.0\r\n" "Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n" "\r\n" "Invitation-Command: ACCEPT\r\n" - "Invitation-Cookie: " + QString::number(cookie()) + "\r\n" + "Invitation-Cookie: " + TQString::number(cookie()) + "\r\n" "IP-Address: " + notify->localIP() + "\r\n" "Port: 6891\r\n" - "AuthCookie: "+QString::number(auth)+"\r\n" + "AuthCookie: "+TQString::number(auth)+"\r\n" "Launch-Application: FALSE\r\n" "Request-Data: IP-Address:\r\n\r\n").utf8(); @@ -416,7 +416,7 @@ void MSNFileTransferSocket::parseInvitation(const QString& msg) } } -void MSNFileTransferSocket::slotFileTransferAccepted(Kopete::Transfer *trans, const QString& fileName) +void MSNFileTransferSocket::slotFileTransferAccepted(Kopete::Transfer *trans, const TQString& fileName) { if(trans->info().internalId().toULong() != cookie()) return; @@ -432,17 +432,17 @@ void MSNFileTransferSocket::slotFileTransferAccepted(Kopete::Transfer *trans, co { setFile(fileName); - QCString message=QString( + TQCString message=TQString( "MIME-Version: 1.0\r\n" "Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n" "\r\n" "Invitation-Command: ACCEPT\r\n" - "Invitation-Cookie: " + QString::number(cookie()) + "\r\n" + "Invitation-Cookie: " + TQString::number(cookie()) + "\r\n" "Launch-Application: FALSE\r\n" "Request-Data: IP-Address:\r\n" ).utf8(); manager->service()->sendCommand( "MSG" , "N", true, message ); - QTimer::singleShot( 3 * 60000, this, SLOT(slotTimer()) ); //if after 3 minutes the transfer has not begin, delete this + TQTimer::singleShot( 3 * 60000, this, TQT_SLOT(slotTimer()) ); //if after 3 minutes the transfer has not begin, delete this } else { diff --git a/kopete/protocols/msn/msnfiletransfersocket.h b/kopete/protocols/msn/msnfiletransfersocket.h index 82ae0662..bf4a07a7 100644 --- a/kopete/protocols/msn/msnfiletransfersocket.h +++ b/kopete/protocols/msn/msnfiletransfersocket.h @@ -18,7 +18,7 @@ #ifndef MSNFILETRANSFERSOCKET_H #define MSNFILETRANSFERSOCKET_H -#include +#include #include "msnsocket.h" #include "msninvitation.h" @@ -42,24 +42,24 @@ class MSNFileTransferSocket : public MSNSocket , public MSNInvitation Q_OBJECT public: - MSNFileTransferSocket(const QString &myID,Kopete::Contact* c, bool incoming, QObject* parent = 0L ); + MSNFileTransferSocket(const TQString &myID,Kopete::Contact* c, bool incoming, TQObject* parent = 0L ); ~MSNFileTransferSocket(); - static QString applicationID() { return "5D3E02AB-6190-11d3-BBBB-00C04F795683"; } - QString invitationHead(); + static TQString applicationID() { return "5D3E02AB-6190-11d3-BBBB-00C04F795683"; } + TQString invitationHead(); void setKopeteTransfer( Kopete::Transfer *kt ); Kopete::Transfer* kopeteTransfer() { return m_kopeteTransfer; } - void setFile( const QString &fn, long unsigned int fileSize = 0L ); - void setAuthCookie( const QString &c ) { m_authcook = c; } - QString fileName() { return m_fileName;} + void setFile( const TQString &fn, long unsigned int fileSize = 0L ); + void setAuthCookie( const TQString &c ) { m_authcook = c; } + TQString fileName() { return m_fileName;} long unsigned int size() { return m_size;} void listen( int port ); - virtual void parseInvitation(const QString& invitation); + virtual void parseInvitation(const TQString& invitation); - virtual QObject* object() { return this; } + virtual TQObject* object() { return this; } public slots: void abort(); @@ -78,35 +78,35 @@ protected: /** * Handle an MSN command response line. */ - virtual void parseCommand(const QString & cmd, uint id, const QString & data); - virtual void bytesReceived(const QByteArray & data); + virtual void parseCommand(const TQString & cmd, uint id, const TQString & data); + virtual void bytesReceived(const TQByteArray & data); protected slots: virtual void slotReadyWrite(); private slots: void slotSocketClosed(); - void slotReadBlock(const QByteArray &); + void slotReadBlock(const TQByteArray &); void slotAcceptConnection(); void slotTimer(); void slotSendFile(); void slotFileTransferRefused( const Kopete::FileTransferInfo &info ); - void slotFileTransferAccepted( Kopete::Transfer *trans, const QString& fileName ); + void slotFileTransferAccepted( Kopete::Transfer *trans, const TQString& fileName ); /* the Kopete::Transfer has been deleted */ void slotKopeteTransferDestroyed(); private: - QString m_handle; + TQString m_handle; Kopete::Contact *m_contact; long unsigned int m_size; long unsigned int m_downsize; - QString m_authcook; - QString m_fileName; + TQString m_authcook; + TQString m_fileName; Kopete::Transfer* m_kopeteTransfer; - QFile *m_file ; + TQFile *m_file ; KNetwork::KServerSocket *m_server; bool ready; diff --git a/kopete/protocols/msn/msninvitation.cpp b/kopete/protocols/msn/msninvitation.cpp index ddc8136a..8a64aa93 100644 --- a/kopete/protocols/msn/msninvitation.cpp +++ b/kopete/protocols/msn/msninvitation.cpp @@ -16,9 +16,9 @@ */ #include "msninvitation.h" #include -#include +#include -MSNInvitation::MSNInvitation(bool incoming, const QString &applicationID , const QString &applicationName) +MSNInvitation::MSNInvitation(bool incoming, const TQString &applicationID , const TQString &applicationName) { m_incoming=incoming; m_applicationId=applicationID; @@ -32,57 +32,57 @@ MSNInvitation::~MSNInvitation() { } -QCString MSNInvitation::unimplemented(long unsigned int cookie) +TQCString MSNInvitation::unimplemented(long unsigned int cookie) { - return QString( "MIME-Version: 1.0\r\n" + return TQString( "MIME-Version: 1.0\r\n" "Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n" "\r\n" "Invitation-Command: CANCEL\r\n" "Cancel-Code: REJECT_NOT_INSTALLED\r\n" - "Invitation-Cookie: " + QString::number(cookie) + "\r\n" + "Invitation-Cookie: " + TQString::number(cookie) + "\r\n" "Session-ID: {120019D9-C3F5-4F94-978D-CB33534C3309}\r\n\r\n").utf8(); //FIXME: i don't know at all what Seession-ID is } -QString MSNInvitation::invitationHead() +TQString MSNInvitation::invitationHead() { setState(Invited); - return QString( "MIME-Version: 1.0\r\n" + return TQString( "MIME-Version: 1.0\r\n" "Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n" "\r\n" "Application-Name: " + m_applicationName + "\r\n" "Application-GUID: {" + m_applicationId + "}\r\n" "Invitation-Command: INVITE\r\n" - "Invitation-Cookie: " +QString::number(m_cookie) +"\r\n"); + "Invitation-Cookie: " +TQString::number(m_cookie) +"\r\n"); } -QCString MSNInvitation::rejectMessage(const QString & rejectcode) +TQCString MSNInvitation::rejectMessage(const TQString & rejectcode) { - return QString( "MIME-Version: 1.0\r\n" + return TQString( "MIME-Version: 1.0\r\n" "Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n" "\r\n" "Invitation-Command: CANCEL\r\n" - "Invitation-Cookie: " + QString::number(cookie()) + "\r\n" + "Invitation-Cookie: " + TQString::number(cookie()) + "\r\n" "Cancel-Code: "+ rejectcode +"\r\n").utf8(); } -void MSNInvitation::parseInvitation(const QString& msg) +void MSNInvitation::parseInvitation(const TQString& msg) { - QRegExp rx("Invitation-Command: ([A-Z]*)"); + TQRegExp rx("Invitation-Command: ([A-Z]*)"); rx.search(msg); - QString command=rx.cap(1); + TQString command=rx.cap(1); if(command=="INVITE") { - rx=QRegExp("Invitation-Cookie: ([0-9]*)"); + rx=TQRegExp("Invitation-Cookie: ([0-9]*)"); rx.search(msg); m_cookie=rx.cap(1).toUInt(); } else if(command=="CANCEL") { - /*rx=QRegExp("Cancel-Code: ([0-9]*)"); + /*rx=TQRegExp("Cancel-Code: ([0-9]*)"); rx.search(msg); - QString code=rx.cap(1).toUInt(); + TQString code=rx.cap(1).toUInt(); //TODO: parse the code*/ } // else if(command=="ACCEPT") diff --git a/kopete/protocols/msn/msninvitation.h b/kopete/protocols/msn/msninvitation.h index 90010dc3..d8b48116 100644 --- a/kopete/protocols/msn/msninvitation.h +++ b/kopete/protocols/msn/msninvitation.h @@ -17,7 +17,7 @@ #ifndef MSNINVITATION_H #define MSNINVITATION_H -#include +#include #include "kopete_export.h" @@ -27,7 +27,7 @@ class QObject; * @author Olivier Goffart * * The invitation is the base class which handle an MSN invitation. - * The implemented class must to herits from QObject too. + * The implemented class must to herits from TQObject too. * You can accept the invitation by catching @ref MSNProtocol::invitation() signals * or create one and insert it to a kmm with @ref MSNChatSession::initInvitation() * you can add action with @ref Kopete::Plugin::customChatActions() @@ -41,14 +41,14 @@ public: * @param applicationID is the exadecimal id of the invitation * @param applicationName is a i18n'ed string of the name of the application */ - MSNInvitation(bool incoming,const QString &applicationID , const QString &applicationName); + MSNInvitation(bool incoming,const TQString &applicationID , const TQString &applicationName); virtual ~MSNInvitation(); /** * @internal * it is a reject invitation because the invitation is not implemented */ - static QCString unimplemented(long unsigned int cookie); + static TQCString unimplemented(long unsigned int cookie); /** * you can set manualy the cookie. note that a cookie is automatically generated when a new @@ -71,24 +71,24 @@ public: * the default implementation return the common begin. * You can also set the state to Invited (the default implementation do that) */ - virtual QString invitationHead(); + virtual TQString invitationHead(); /** * This is the reject invitation string * @param rejectcode is the code, it can be "REJECT" or "TIMEOUT" */ - QCString rejectMessage(const QString & rejectcode = "REJECT"); + TQCString rejectMessage(const TQString & rejectcode = "REJECT"); /** * reimplement this method. it is called when an invitation message with the invitation's cookie is received * the default implementation parse the cookie, or the reject message */ - virtual void parseInvitation(const QString& invitation); + virtual void parseInvitation(const TQString& invitation); /** * return the qobject (this) */ - virtual QObject* object()=0; + virtual TQObject* object()=0; //signals: /** * reimplement this as a signal, and emit it when the invitation has to be destroyed. @@ -116,8 +116,8 @@ public: protected: bool m_incoming; long unsigned int m_cookie; - QString m_applicationId; - QString m_applicationName; + TQString m_applicationId; + TQString m_applicationName; State m_state; diff --git a/kopete/protocols/msn/msnnotifysocket.cpp b/kopete/protocols/msn/msnnotifysocket.cpp index e31e0257..3b3fc531 100644 --- a/kopete/protocols/msn/msnnotifysocket.cpp +++ b/kopete/protocols/msn/msnnotifysocket.cpp @@ -28,9 +28,9 @@ #include "msnsecureloginhandler.h" #include "msnchallengehandler.h" -#include -#include -#include +#include +#include +#include #include #include @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include @@ -51,7 +51,7 @@ #include -MSNNotifySocket::MSNNotifySocket( MSNAccount *account, const QString& /*msnId*/, const QString &password ) +MSNNotifySocket::MSNNotifySocket( MSNAccount *account, const TQString& /*msnId*/, const TQString &password ) : MSNSocket( account ) { m_newstatus = MSNProtocol::protocol()->NLN; @@ -64,8 +64,8 @@ MSNNotifySocket::MSNNotifySocket( MSNAccount *account, const QString& /*msnId*/, m_account = account; m_password=password; - QObject::connect( this, SIGNAL( blockRead( const QByteArray & ) ), - this, SLOT( slotReadMessage( const QByteArray & ) ) ); + TQObject::connect( this, TQT_SIGNAL( blockRead( const TQByteArray & ) ), + this, TQT_SLOT( slotReadMessage( const TQByteArray & ) ) ); m_keepaliveTimer = 0L; m_isLogged = false; } @@ -91,7 +91,7 @@ void MSNNotifySocket::disconnect() if( m_disconnectReason==Kopete::Account::Unknown ) m_disconnectReason=Kopete::Account::Manual; if( onlineStatus() == Connected ) - sendCommand( "OUT", QString::null, false ); + sendCommand( "OUT", TQString::null, false ); if( m_keepaliveTimer ) m_keepaliveTimer->stop(); @@ -107,11 +107,11 @@ void MSNNotifySocket::handleError( uint code, uint id ) { kdDebug(14140) << k_funcinfo << endl; - QString handle; + TQString handle; if(m_tmpHandles.contains(id)) handle=m_tmpHandles[id]; - QString msg; + TQString msg; MSNSocket::ErrorType type; // See http://www.hypothetic.org/docs/msn/basics.php for a // description of all possible error codes. @@ -148,7 +148,7 @@ void MSNNotifySocket::handleError( uint code, uint id ) } /*else { - QString msg = i18n( "You are trying to change the display name of a user who has not " + TQString msg = i18n( "You are trying to change the display name of a user who has not " "confirmed his or her email address;\n" "the contact was not renamed on the server." ); KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, msg, i18n( "MSN Plugin" ) ); @@ -218,7 +218,7 @@ void MSNNotifySocket::handleError( uint code, uint id ) { /* //if(handlev==m_account->accountId()) - QString msg = i18n( "Your email address has not been verified with the MSN server.\n" + TQString msg = i18n( "Your email address has not been verified with the MSN server.\n" "You should have received a mail with a link to confirm your email address.\n" "Some functions will be restricted if you do not confirm your email address." ); KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );//TODO don't show again @@ -230,7 +230,7 @@ void MSNNotifySocket::handleError( uint code, uint id ) //This happen when too much commends are sent to the server. //the command will not be executed, too bad. // ignore it for now, as we don't really know what command it was. - /* QString msg = i18#n( "You are trying to change your status, or your display name too rapidly.\n" + /* TQString msg = i18#n( "You are trying to change your status, or your display name too rapidly.\n" "This might happen if you added yourself to your own contact list." ); KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) ); //FIXME: try to fix this problem*/ @@ -262,7 +262,7 @@ void MSNNotifySocket::handleError( uint code, uint id ) emit errorMessage( type, msg ); } -void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString &data ) +void MSNNotifySocket::parseCommand( const TQString &cmd, uint id, const TQString &data ) { //kdDebug(14140) << "MSNNotifySocket::parseCommand: Command: " << cmd << endl; @@ -288,9 +288,9 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & { m_secureLoginHandler = new MSNSecureLoginHandler(m_account->accountId(), m_password, data.section( ' ' , 2 , 2 )); - QObject::connect(m_secureLoginHandler, SIGNAL(loginFailed()), this, SLOT(sslLoginFailed())); - QObject::connect(m_secureLoginHandler, SIGNAL(loginBadPassword()), this, SLOT(sslLoginIncorrect())); - QObject::connect(m_secureLoginHandler, SIGNAL(loginSuccesful(QString )), this, SLOT(sslLoginSucceeded(QString ))); + TQObject::connect(m_secureLoginHandler, TQT_SIGNAL(loginFailed()), this, TQT_SLOT(sslLoginFailed())); + TQObject::connect(m_secureLoginHandler, TQT_SIGNAL(loginBadPassword()), this, TQT_SLOT(sslLoginIncorrect())); + TQObject::connect(m_secureLoginHandler, TQT_SIGNAL(loginSuccesful(TQString )), this, TQT_SLOT(sslLoginSucceeded(TQString ))); m_secureLoginHandler->login(); } @@ -300,7 +300,7 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & m_disconnectReason=Kopete::Account::Unknown; // Synchronize with the server. - QString lastSyncTime, lastChange; + TQString lastSyncTime, lastChange; if(m_account->contacts().count() > 1) { @@ -331,10 +331,10 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & // LST N=passport@hotmail.com F=Display%20Name C=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 13 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx // But can be // LST N=passport@hotmail.com 10 - QString publicName, contactGuid, groups; + TQString publicName, contactGuid, groups; uint lists; - QRegExp regex("N=([^ ]+)(?: F=([^ ]+))?(?: C=([0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}))? (\\d+)\\s?((?:[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12},?)*)$"); + TQRegExp regex("N=([^ ]+)(?: F=([^ ]+))?(?: C=([0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}))? (\\d+)\\s?((?:[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12},?)*)$"); regex.search(data); // Capture passport email. @@ -368,12 +368,12 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & MSNContact *c = static_cast( m_account->contacts()[ data.section( ' ', 1, 1 ) ] ); if( c && c->contactId() != m_account->accountId() ) { - QString publicName=unescape( data.section( ' ', 2, 2 ) ); + TQString publicName=unescape( data.section( ' ', 2, 2 ) ); if ( (publicName!=c->contactId() || c->hasProperty(Kopete::Global::Properties::self()->nickName().key()) ) && publicName!=c->property( Kopete::Global::Properties::self()->nickName()).value().toString() ) changePublicName(publicName,c->contactId()); - QString obj=unescape(data.section( ' ', 4, 4 )); + TQString obj=unescape(data.section( ' ', 4, 4 )); c->setObject( obj ); c->setOnlineStatus( convertOnlineStatus( data.section( ' ', 0, 0 ) ) ); c->setClientFlags(data.section( ' ', 3, 3 ).toUInt()); @@ -391,7 +391,7 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & { // UUX is sended to acknowledge that the server has received and processed the personal Message. // if the result is 0, set the myself() contact personalMessage. - if( data.section(' ', 0, 0) == QString::fromUtf8("0") ) + if( data.section(' ', 0, 0) == TQString::fromUtf8("0") ) m_account->myself()->setProperty(MSNProtocol::protocol()->propPersonalMessage, m_propertyPersonalMessage); } else if( cmd == "FLN" ) @@ -405,7 +405,7 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & } else if( cmd == "XFR" ) { - QString stype=data.section( ' ', 0, 0 ); + TQString stype=data.section( ' ', 0, 0 ); if( stype=="SB" ) //switchboard connection (chat) { // Address, AuthInfo @@ -413,8 +413,8 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & } else if( stype=="NS" ) //notifysocket ; Got our notification server { //we are connecting and we receive the initial NS, or the msn server encounter a problem, and we are switching to another switchboard - QString host = data.section( ' ', 1, 1 ); - QString server = host.section( ':', 0, 0 ); + TQString host = data.section( ' ', 1, 1 ); + TQString server = host.section( ':', 0, 0 ); uint port = host.section( ':', 1, 1 ).toUInt(); setOnlineStatus( Connected ); emit receivedNotificationServer( server, port ); @@ -425,12 +425,12 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & else if( cmd == "RNG" ) { // SessionID, Address, AuthInfo, handle, publicName - emit invitedToChat( QString::number( id ), data.section( ' ', 0, 0 ), data.section( ' ', 2, 2 ), + emit invitedToChat( TQString::number( id ), data.section( ' ', 0, 0 ), data.section( ' ', 2, 2 ), data.section( ' ', 3, 3 ), unescape( data.section( ' ', 4, 4 ) ) ); } else if( cmd == "ADC" ) { - QString msnId, list, publicName, contactGuid, groupGuid; + TQString msnId, list, publicName, contactGuid, groupGuid; // Retrieve the list parameter (FL/AL/BL/RL) list = data.section( ' ', 0, 0 ); @@ -441,7 +441,7 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & // ADC TrID RL N=example@passport.com F=friednly%20name // ADC TrID FL N=ex@pas.com F=My%20Name C=contactGuid // Thanks Gregg for that complex RegExp. - QRegExp regex("(?:N=([^ ]+))?(?: F=([^ ]+))?(?: C=([0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}))?\\s?((?:[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12},?)*)$"); + TQRegExp regex("(?:N=([^ ]+))?(?: F=([^ ]+))?(?: C=([0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}))?\\s?((?:[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12},?)*)$"); regex.search( data.section( ' ', 1 ) ); // Capture passport email. @@ -460,7 +460,7 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & } else if( cmd == "REM" ) // someone is removed from a list { - QString handle, list, contactGuid, groupGuid; + TQString handle, list, contactGuid, groupGuid; list = data.section( ' ', 0, 0 ); if( list == "FL" ) { @@ -495,13 +495,13 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & } else if( cmd == "CHG" ) { - QString status = data.section( ' ', 0, 0 ); + TQString status = data.section( ' ', 0, 0 ); setOnlineStatus( Connected ); emit statusChanged( convertOnlineStatus( status ) ); } else if( cmd == "SBP" ) { - QString contactGuid, type, publicName; + TQString contactGuid, type, publicName; contactGuid = data.section( ' ', 0, 0 ); type = data.section( ' ', 1, 1 ); if(type == "MFN" ) @@ -540,7 +540,7 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & { m_challengeHandler = new MSNChallengeHandler("CFHUR$52U_{VIX5T", "PROD0101{0RM?UBW"); // Compute the challenge response hash, and send the response. - QString chlResponse = m_challengeHandler->computeHash(data.section(' ', 0, 0)); + TQString chlResponse = m_challengeHandler->computeHash(data.section(' ', 0, 0)); sendCommand("QRY", m_challengeHandler->productId(), true, chlResponse.utf8()); // Dispose of the challenge handler. m_challengeHandler->deleteLater(); @@ -549,8 +549,8 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & else if( cmd == "SYN" ) { // Retrieve the last synchronization timestamp known to the server. - QString lastSyncTime = data.section( ' ', 1, 1 ); - QString lastChange = data.section( ' ', 0, 0 ); + TQString lastSyncTime = data.section( ' ', 1, 1 ); + TQString lastChange = data.section( ' ', 0, 0 ); if( lastSyncTime != m_account->configGroup()->readEntry("lastsynctime") || lastChange != m_account->configGroup()->readEntry("lastchange") ) { @@ -576,8 +576,8 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & MSNContact *c = static_cast( m_account->myself() ); if( c ) { - QString type = data.section( ' ', 0, 0 ); - QString prpData = unescape( data.section( ' ', 1, 1 ) ); //SECURITY???????? + TQString type = data.section( ' ', 0, 0 ); + TQString prpData = unescape( data.section( ' ', 1, 1 ) ); //SECURITY???????? c->setInfo( type, prpData ); m_account->configGroup()->writeEntry( type, prpData ); } @@ -610,21 +610,21 @@ void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString & { // URL 6 /cgi-bin/HoTMaiL https://loginnet.passport.com/ppsecure/md5auth.srf?lc=1033 2 //example of reply: URL 10 /cgi-bin/HoTMaiL https://msnialogin.passport.com/ppsecure/md5auth.srf?lc=1036 3 - QString from_action_url = data.section( ' ', 1, 1 ); - QString rru = data.section( ' ', 0, 0 ); - QString id = data.section( ' ', 2, 2 ); + TQString from_action_url = data.section( ' ', 1, 1 ); + TQString rru = data.section( ' ', 0, 0 ); + TQString id = data.section( ' ', 2, 2 ); //write the tmp file - QString UserID=m_account->accountId(); + TQString UserID=m_account->accountId(); time_t actualTime; time(&actualTime); - QString sl = QString::number( ( unsigned long ) actualTime - m_loginTime.toULong() ); + TQString sl = TQString::number( ( unsigned long ) actualTime - m_loginTime.toULong() ); - QString md5this( m_MSPAuth + sl + m_password ); + TQString md5this( m_MSPAuth + sl + m_password ); KMD5 md5( md5this.utf8() ); - QString hotmailRequest = "\n" + TQString hotmailRequest = "\n" "\n" "