From 03b7858c880ea1fba3915af17c55b42d5e13c58a Mon Sep 17 00:00:00 2001 From: Nils Schwabe Date: Tue, 4 Mar 2014 17:54:57 +0100 Subject: - included the --url commandline options for a xml url - httpxmldownloader moved to main.cpp (it's finally working :D) - given url is downloaded and printed on commandline - todo: parse http response --- src/httpxmldownloader.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/httpxmldownloader.cpp') diff --git a/src/httpxmldownloader.cpp b/src/httpxmldownloader.cpp index 4474b9d..788f8f2 100644 --- a/src/httpxmldownloader.cpp +++ b/src/httpxmldownloader.cpp @@ -6,11 +6,17 @@ httpxmldownloader::httpxmldownloader() { nam = new QNetworkAccessManager(this); QObject::connect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finishedSlot(QNetworkReply*))); + /** + * TODO: + * connect readyRead() + * + */ - QString url_string = "http://localhost/test.xml"; + qDebug() << "httpdownloader"; +} - QUrl url(url_string); - nam->get(QNetworkRequest(url)); +QNetworkReply* httpxmldownloader::makeRequest(const QString& xmlurl) { + return nam->get(QNetworkRequest(QUrl(xmlurl))); } void httpxmldownloader::finishedSlot(QNetworkReply* reply) { -- cgit v1.2.3-55-g7522