diff options
| author | 2008-09-24 08:30:54 +0000 | |
|---|---|---|
| committer | 2008-09-24 08:30:54 +0000 | |
| commit | edc59c8a19f05f8b3eca59eb0a20ac7532634845 (patch) | |
| tree | d8407c7c5c61bd48fe035fd3387600827c6aaff4 /src/modules | |
| parent | forward-port newline fix, refs r2540 (diff) | |
| download | KVIrc-edc59c8a19f05f8b3eca59eb0a20ac7532634845.tar.gz KVIrc-edc59c8a19f05f8b3eca59eb0a20ac7532634845.tar.bz2 KVIrc-edc59c8a19f05f8b3eca59eb0a20ac7532634845.zip | |
finished porting of module upnp to pure qt4
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2543 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/upnp/manager.cpp | 3 | ||||
| -rw-r--r-- | src/modules/upnp/service.cpp | 2 | ||||
| -rw-r--r-- | src/modules/upnp/ssdpconnection.cpp | 6 | ||||
| -rw-r--r-- | src/modules/upnp/xmlfunctions.cpp | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/src/modules/upnp/manager.cpp b/src/modules/upnp/manager.cpp index cb8610b4e..64072c16c 100644 --- a/src/modules/upnp/manager.cpp +++ b/src/modules/upnp/manager.cpp @@ -89,7 +89,8 @@ void Manager::initialize() m_bBroadcastFailed = false; m_bBroadcastFoundIt = false; m_pSsdpConnection->queryDevices(); - m_pSsdpTimer->start(2000, true); + m_pSsdpTimer->setSingleShot(true); + m_pSsdpTimer->start(2000); } diff --git a/src/modules/upnp/service.cpp b/src/modules/upnp/service.cpp index 9246514af..9806086a2 100644 --- a/src/modules/upnp/service.cpp +++ b/src/modules/upnp/service.cpp @@ -143,7 +143,7 @@ int Service::callActionInternal(const QString &actionName, const QMap<QString,QS for(it = arguments->begin(); it != arguments->end(); ++it) { QString argumentName = it.key(); - soapMessage += "<" + argumentName + ">" + it.data() + "</" + argumentName + ">"; + soapMessage += "<" + argumentName + ">" + it.value() + "</" + argumentName + ">"; } } diff --git a/src/modules/upnp/ssdpconnection.cpp b/src/modules/upnp/ssdpconnection.cpp index a36dca317..7bd1c87e3 100644 --- a/src/modules/upnp/ssdpconnection.cpp +++ b/src/modules/upnp/ssdpconnection.cpp @@ -97,8 +97,8 @@ void SsdpConnection::slotDataReceived() QString sspdResponse = QString::fromUtf8(datagram.data(), datagram.size()); // Find the location field manually, MimeMessage is not required - int locationStart = sspdResponse.find("LOCATION:",0,false); // case insensitive - int locationEnd = sspdResponse.find("\r\n",locationStart); + int locationStart = sspdResponse.indexOf("LOCATION:",0,Qt::CaseInsensitive); + int locationEnd = sspdResponse.indexOf("\r\n",locationStart,Qt::CaseSensitive); locationStart += 9; // length of field name QString location = sspdResponse.mid(locationStart, locationEnd - locationStart); @@ -138,7 +138,7 @@ void SsdpConnection::queryDevices(int bindPort) } // Send the data - QByteArray dataBlock = data.utf8(); + QByteArray dataBlock = data.toUtf8(); int bytesWritten = m_pSocket->writeDatagram(dataBlock.data(), dataBlock.size(), address, 1900); if(bytesWritten == -1) diff --git a/src/modules/upnp/xmlfunctions.cpp b/src/modules/upnp/xmlfunctions.cpp index d50c735d8..b23c8235c 100644 --- a/src/modules/upnp/xmlfunctions.cpp +++ b/src/modules/upnp/xmlfunctions.cpp @@ -40,7 +40,7 @@ QDomNode XmlFunctions::getNode( const QDomNode &rootNode, const QString &path ) { - QStringList pathItems = QStringList::split( "/", path, false ); + QStringList pathItems = path.split( "/", QString::SkipEmptyParts ); QDomNode childNode = rootNode.namedItem( pathItems[0] ); // can be a null node uint i = 1; @@ -120,7 +120,7 @@ QString XmlFunctions::getNodeValue( const QDomNode &rootNode, const QString &pat QString XmlFunctions::getSource( const QDomNode &node, int indent ) { QString source; - QTextStream textStream( &source, IO_WriteOnly ); + QTextStream textStream( &source, QIODevice::WriteOnly ); node.save( textStream, indent ); return source; } |
