diff options
| author | 2012-09-25 13:15:57 +0000 | |
|---|---|---|
| committer | 2012-09-25 13:15:57 +0000 | |
| commit | 4602a1a7ac1f4b2fd33bb1581f4eedd1edd65a9c (patch) | |
| tree | 2a36735ae8685b0d6011f1bfdf0d27ec6211089b /src/modules/upnp/Service.cpp | |
| parent | Properly sort the console windows when sorting by name is selected in the tre... (diff) | |
| download | KVIrc-4602a1a7ac1f4b2fd33bb1581f4eedd1edd65a9c.tar.gz KVIrc-4602a1a7ac1f4b2fd33bb1581f4eedd1edd65a9c.tar.bz2 KVIrc-4602a1a7ac1f4b2fd33bb1581f4eedd1edd65a9c.zip | |
qt5 support (sip): code only, no touch to build system by now
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@6251 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/upnp/Service.cpp')
| -rw-r--r-- | src/modules/upnp/Service.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/modules/upnp/Service.cpp b/src/modules/upnp/Service.cpp index b29255e16..3a889465b 100644 --- a/src/modules/upnp/Service.cpp +++ b/src/modules/upnp/Service.cpp @@ -34,8 +34,12 @@ #include "Service.h" #include "XmlFunctions.h" +#warning upnp/Service uses QHttp, it must be either ported or dropped + #include <QDebug> +#if (QT_VERSION < 0x050000) #include <QHttp> +#endif #include <QByteArray> // This implementation was created with the help of the following documentation: @@ -57,9 +61,10 @@ Service::Service(const QString &hostname, int port, const QString &informationUr , m_iPort(port) { m_szInformationUrl = informationUrl; +#if (QT_VERSION < 0x050000) m_pHttp = new QHttp(hostname, port); connect(m_pHttp, SIGNAL( requestFinished(int,bool) ), this, SLOT( slotRequestFinished(int,bool) ) ); - +#endif qDebug() << "UPnP::Service: Created information service url='" << m_szInformationUrl << "'." << endl; } @@ -75,9 +80,10 @@ Service::Service(const ServiceParameters ¶ms) , m_szHostname(params.hostname) , m_iPort(params.port) { +#if (QT_VERSION < 0x050000) m_pHttp = new QHttp(params.hostname, params.port); connect(m_pHttp, SIGNAL( requestFinished(int,bool) ), this, SLOT( slotRequestFinished(int,bool) ) ); - +#endif qDebug() << "CREATED UPnP::Service: url='" << m_szControlUrl << "' id='" << m_szServiceId << "'." << endl; } @@ -87,8 +93,9 @@ Service::Service(const ServiceParameters ¶ms) Service::~Service() { qDebug() << "DESTROYED UPnP::Service [url=" << m_szControlUrl << ", id=" << m_szServiceId << "]" << endl; - +#if (QT_VERSION < 0x050000) delete m_pHttp; +#endif } @@ -114,6 +121,7 @@ int Service::callAction(const QString &actionName, const QMap<QString,QString> & int Service::callActionInternal(const QString &actionName, const QMap<QString,QString> *arguments, const QString &prefix) { qDebug() << "UPnP::Service: calling remote procedure '" << actionName << "'." << endl; +#if (QT_VERSION < 0x050000) // Create the data message //NOTE: we shouldm use serviceId_ instead of serviceType_, but it seems that my router @@ -166,7 +174,9 @@ int Service::callActionInternal(const QString &actionName, const QMap<QString,QS m_iPendingRequests++; qDebug() << "Sending request:\n" << header.toString() << "\n---" << content << endl; + return m_pHttp->request(header, content); +#endif } @@ -181,7 +191,9 @@ int Service::callInformationUrl() // Send the GET request // TODO: User-Agent: Mozilla/4.0 (compatible; UPnP/1.0; Windows NT/5.1) m_iPendingRequests++; +#if (QT_VERSION < 0x050000) return m_pHttp->get(m_szInformationUrl); +#endif } @@ -224,6 +236,7 @@ void Service::gotInformationResponse(const QDomNode &response) // The QHttp object retrieved data. void Service::slotRequestFinished(int id, bool error) { +#if (QT_VERSION < 0x050000) qDebug() << "UPnP::Service: Got HTTP response for request #"<< id << ", state: " << m_pHttp->state() << ", " << m_pHttp->bytesAvailable() << " bytes." << endl; if(! error) @@ -324,7 +337,7 @@ void Service::slotRequestFinished(int id, bool error) m_iPendingRequests--; emit queryFinished(error); } - +#endif } |
