Build error log: [ 21%] Building CXX object src/CMakeFiles/konversation.dir/upnp/upnprouter.o /home/sho/kdevel/4/src/konversation/src/upnp/upnprouter.cpp: In member function ‘KJob* Konversation::UPnP::UPnPRouter::sendSoapQuery(const QString&, const QString&, const QString&)’: /home/sho/kdevel/4/src/konversation/src/upnp/upnprouter.cpp:322: error: ‘storedHttpPost’ is not a member of ‘KIO’ make[2]: *** [src/CMakeFiles/konversation.dir/upnp/upnprouter.o] Error 1 make[1]: *** [src/CMakeFiles/konversation.dir/all] Error 2 make: *** [all] Error 2
I think you should update to a newer revision and use Qt 4.5.
I mean that Qt 4.4 and KDE 4.1 are quite old (looking at the evolution on this last year) :-)
FiNeX, I appreciate your enthusiasm, but I'm the maintainer of the app, and we happen to support KDE 4.1 and Qt 4.4 -- I know what I'm doing when I file a report.
Ok, don't worry :-)
SVN commit 1026112 by mkreitzer: Use KIO::http_post instead of KIO::storedHttpPost to restore KDE 4.1 compatability. BUG: 207857 M +26 -6 upnprouter.cpp M +8 -3 upnprouter.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1026112
commit 979fa6ab9b5236eb7a81399867bf6769cded919c Author: Michael Kreitzer <mrgrim@gr1m.org> Date: Sun Sep 20 19:45:09 2009 +0000 Use KIO::http_post instead of KIO::storedHttpPost to restore KDE 4.1 compatability. BUG: 207857 svn path=/trunk/extragear/network/konversation/; revision=1026112 diff --git a/src/upnp/upnprouter.cpp b/src/upnp/upnprouter.cpp index 4a8b5d6..cf247d5 100644 --- a/src/upnp/upnprouter.cpp +++ b/src/upnp/upnprouter.cpp @@ -21,6 +21,7 @@ #include <KLocale> #include <KIO/Job> #include <KIO/NetAccess> +#include <kio/jobclasses.h> #include <stdlib.h> @@ -310,8 +311,6 @@ namespace Konversation if (location.port()<=0) location.setPort(80); - QByteArray data = query.toAscii(); - KUrl address; address.setProtocol(QString("http")); @@ -319,16 +318,34 @@ namespace Konversation address.setPort(location.port()); address.setPath(controlurl); - KIO::TransferJob *req = KIO::storedHttpPost( data, address, KIO::HideProgressInfo ); + KIO::TransferJob *req = KIO::http_post( address, query.toAscii(), KIO::HideProgressInfo ); + req->addMetaData("content-type", QString("text/xml")); req->addMetaData("UserAgent", QString("Konversation UPnP")); req->addMetaData("customHTTPHeader", QString("SOAPAction: ") + soapact); - connect(req,SIGNAL(result(KJob *)),this,SLOT(onRequestFinished( KJob* ))); + soap_data_out[req] = QByteArray(); + soap_data_in[req] = QByteArray(); + + connect( req, SIGNAL(data( KIO::Job *, const QByteArray & )), this, SLOT(recvSoapData( KIO::Job*, const QByteArray & )) ); + connect( req, SIGNAL(dataReq( KIO::Job *, QByteArray & )), this, SLOT(sendSoapData( KIO::Job*, QByteArray & )) ); + + connect( req, SIGNAL(result(KJob *)), this, SLOT(onRequestFinished( KJob* )) ); return req; } + void UPnPRouter::sendSoapData(KIO::Job *job, QByteArray &data) + { + data.append(soap_data_out[job]); + soap_data_out[job].clear(); + } + + void UPnPRouter::recvSoapData(KIO::Job *job, const QByteArray &data) + { + soap_data_in[job].append(data); + } + void UPnPRouter::onRequestFinished(KJob *r) { if (r->error()) @@ -356,8 +373,8 @@ namespace Konversation } else { - KIO::StoredTransferJob* st = (KIO::StoredTransferJob*)r; - QString reply(st->data()); + QString reply(soap_data_in[r]); + soap_data_in[r].clear(); kDebug() << "UPnPRouter : OK:" << endl; @@ -388,6 +405,9 @@ namespace Konversation pending_unforwards.remove(r); } } + + soap_data_in.remove(r); + soap_data_out.remove(r); } } } diff --git a/src/upnp/upnprouter.h b/src/upnp/upnprouter.h index 82b9e05..70b5312 100644 --- a/src/upnp/upnprouter.h +++ b/src/upnp/upnprouter.h @@ -17,6 +17,7 @@ #include <kurl.h> #include <kjob.h> +#include <kio/jobclasses.h> namespace Konversation { @@ -110,6 +111,9 @@ namespace Konversation QHash<KJob*, Forwarding*> pending_forwards; QHash<KJob*, Forwarding*> pending_unforwards; + QHash<KJob*, QByteArray> soap_data_in; + QHash<KJob*, QByteArray> soap_data_out; + QString error; public: @@ -170,9 +174,10 @@ namespace Konversation private slots: void onRequestFinished(KJob *reply); void downloadFinished(KJob* j); - - - + + void sendSoapData(KIO::Job *job, QByteArray &data); + void recvSoapData(KIO::Job *job, const QByteArray &data); + signals: /** * Signal which indicates that the XML was downloaded successfully or not.