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/msnfiletransfersocket.cpp | 102 ++++++++++++------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'kopete/protocols/msn/msnfiletransfersocket.cpp') 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 { -- cgit v1.2.1