diff options
Diffstat (limited to 'src/upnp/upnpmcastsocket.cpp')
-rw-r--r-- | src/upnp/upnpmcastsocket.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/upnp/upnpmcastsocket.cpp b/src/upnp/upnpmcastsocket.cpp index 48159c2..70853de 100644 --- a/src/upnp/upnpmcastsocket.cpp +++ b/src/upnp/upnpmcastsocket.cpp @@ -27,13 +27,13 @@ #include <netinet/ip.h> #include <arpa/inet.h> #include <netinet/ip.h> -#include <qstringlist.h> +#include <ntqstringlist.h> #include <ksocketdevice.h> #include <ksocketaddress.h> /*#include <util/log.h> #include <torrent/globals.h>*/ -#include <qfile.h> -#include <qtextstream.h> +#include <ntqfile.h> +#include <ntqtextstream.h> #include "upnpmcastsocket.h" @@ -47,14 +47,14 @@ namespace kt UPnPMCastSocket::UPnPMCastSocket(bool verbose) : verbose(verbose) { routers.setAutoDelete(true); - QObject::connect(this,SIGNAL(readyRead()),this,SLOT(onReadyRead())); - QObject::connect(this,SIGNAL(gotError(int)),this,SLOT(onError(int))); + TQObject::connect(this,SIGNAL(readyRead()),this,SLOT(onReadyRead())); + TQObject::connect(this,SIGNAL(gotError(int)),this,SLOT(onError(int))); setAddressReuseable(true); setFamily(KNetwork::KResolver::IPv4Family); setBlocking(true); for (Uint32 i = 0;i < 10;i++) { - if (!bind(QString::null,QString::number(1900 + i))) + if (!bind(TQString::null,TQString::number(1900 + i))) kdDebug() << "Cannot bind to UDP port 1900" << endl; else break; @@ -67,8 +67,8 @@ namespace kt UPnPMCastSocket::~UPnPMCastSocket() { leaveUPnPMCastGroup(); - QObject::disconnect(this,SIGNAL(readyRead()),this,SLOT(onReadyRead())); - QObject::disconnect(this,SIGNAL(gotError(int)),this,SLOT(onError(int))); + TQObject::disconnect(this,SIGNAL(readyRead()),this,SLOT(onReadyRead())); + TQObject::disconnect(this,SIGNAL(gotError(int)),this,SLOT(onError(int))); } void UPnPMCastSocket::discover() @@ -135,14 +135,14 @@ namespace kt if (verbose) { kdDebug() << "Received : " << endl; - kdDebug() << QString(p.data()) << endl; + kdDebug() << TQString(p.data()) << endl; } // try to make a router of it UPnPRouter* r = parseResponse(p.data()); if (r) { - QObject::connect(r,SIGNAL(xmlFileDownloaded( UPnPRouter*, bool )), + TQObject::connect(r,SIGNAL(xmlFileDownloaded( UPnPRouter*, bool )), this,SLOT(onXmlFileDownloaded( UPnPRouter*, bool ))); // download it's xml file @@ -150,10 +150,10 @@ namespace kt } } - UPnPRouter* UPnPMCastSocket::parseResponse(const QByteArray & arr) + UPnPRouter* UPnPMCastSocket::parseResponse(const TQByteArray & arr) { - QStringList lines = QStringList::split("\r\n",QString(arr),false); - QString server; + TQStringList lines = TQStringList::split("\r\n",TQString(arr),false); + TQString server; KURL location; @@ -163,7 +163,7 @@ namespace kt // first read first line and see if contains a HTTP 200 OK message - QString line = lines.first(); + TQString line = lines.first(); if (!line.contains("HTTP")) { // it is either a 200 OK or a NOTIFY @@ -225,9 +225,9 @@ namespace kt kdDebug() << "UPnPMCastSocket Error : " << errorString() << endl; } - void UPnPMCastSocket::saveRouters(const QString & file) + void UPnPMCastSocket::saveRouters(const TQString & file) { - QFile fptr(file); + TQFile fptr(file); if (!fptr.open(IO_WriteOnly)) { kdDebug() << "Cannot open file " << file << " : " << fptr.errorString() << endl; @@ -236,8 +236,8 @@ namespace kt // file format is simple : 2 lines per router, // one containing the server, the other the location - QTextStream fout(&fptr); - bt::PtrMap<QString,UPnPRouter>::iterator i = routers.begin(); + TQTextStream fout(&fptr); + bt::PtrMap<TQString,UPnPRouter>::iterator i = routers.begin(); while (i != routers.end()) { UPnPRouter* r = i->second; @@ -247,9 +247,9 @@ namespace kt } } - void UPnPMCastSocket::loadRouters(const QString & file) + void UPnPMCastSocket::loadRouters(const TQString & file) { - QFile fptr(file); + TQFile fptr(file); if (!fptr.open(IO_ReadOnly)) { kdDebug() << "Cannot open file " << file << " : " << fptr.errorString() << endl; @@ -258,18 +258,18 @@ namespace kt // file format is simple : 2 lines per router, // one containing the server, the other the location - QTextStream fin(&fptr); + TQTextStream fin(&fptr); while (!fin.atEnd()) { - QString server, location; + TQString server, location; server = fin.readLine(); location = fin.readLine(); if (!routers.contains(server)) { UPnPRouter* r = new UPnPRouter(server,location); // download it's xml file - QObject::connect(r,SIGNAL(xmlFileDownloaded( UPnPRouter*, bool )),this,SLOT(onXmlFileDownloaded( UPnPRouter*, bool ))); + TQObject::connect(r,SIGNAL(xmlFileDownloaded( UPnPRouter*, bool )),this,SLOT(onXmlFileDownloaded( UPnPRouter*, bool ))); r->downloadXMLFile(); } } |