summaryrefslogtreecommitdiffstats
path: root/src/httpxmldownloader.cpp
blob: c14399545b29a7e024ede4a848a127414b3356e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

#include "httpxmldownloader.h"
#include <QDebug>
#include <QUrlQuery>

HttpXmlDownloader::HttpXmlDownloader() {
    nam = new QNetworkAccessManager(this);
}

QNetworkReply* HttpXmlDownloader::makeRequest(const QString& xmlurl, const QString& locationIds) {
    QUrl url(xmlurl);
    if (!locationIds.isEmpty()) {
        QUrlQuery query(url);
        query.addQueryItem("locations", locationIds);
        url.setQuery(query);
    }
    return nam->get(QNetworkRequest(url));
}

void HttpXmlDownloader::connectSlot(QObject* obj, const char* slot) {
    QObject::connect(nam, SIGNAL(finished(QNetworkReply*)), obj, slot);
}