summaryrefslogtreecommitdiffstats
path: root/src/libs/installer
diff options
context:
space:
mode:
authorNiels Weber <niels.weber@digia.com>2013-09-12 13:21:34 +0200
committerNiels Weber <niels.weber@digia.com>2013-09-13 13:12:27 +0200
commit8b5184531cda6dadaec55d70921703db6f50f182 (patch)
treeb648b8ea2937fc3cf09d422d5c6adf6c09b8255a /src/libs/installer
parent50f2bf8baf69425b39a68fa9001b6769390deff0 (diff)
Add support to pass a query string when downloading archives.
Task-number: QTIFW-329 Change-Id: I645370f03958164905c064d1dcf0be97fd8dc039 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'src/libs/installer')
-rw-r--r--src/libs/installer/downloadarchivesjob.cpp9
-rw-r--r--src/libs/installer/downloadarchivesjob.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/libs/installer/downloadarchivesjob.cpp b/src/libs/installer/downloadarchivesjob.cpp
index 24fba689a..82f9b365c 100644
--- a/src/libs/installer/downloadarchivesjob.cpp
+++ b/src/libs/installer/downloadarchivesjob.cpp
@@ -182,7 +182,7 @@ void DownloadArchivesJob::fetchNextArchive()
if (m_downloader != 0)
m_downloader->deleteLater();
- m_downloader = setupDownloader();
+ m_downloader = setupDownloader(QString(), m_core->value(QLatin1String("UrlQueryString")));
if (!m_downloader) {
m_archivesToDownload.removeFirst();
QMetaObject::invokeMethod(this, "fetchNextArchive", Qt::QueuedConnection);
@@ -292,13 +292,16 @@ void DownloadArchivesJob::finishWithError(const QString &error)
emitFinishedWithError(QInstaller::DownloadError, msg.arg(error, m_downloader->url().toString()));
}
-KDUpdater::FileDownloader *DownloadArchivesJob::setupDownloader(const QString &suffix)
+KDUpdater::FileDownloader *DownloadArchivesJob::setupDownloader(const QString &suffix, const QString &queryString)
{
KDUpdater::FileDownloader *downloader = 0;
const QFileInfo fi = QFileInfo(m_archivesToDownload.first().first);
const Component *const component = m_core->componentByName(QFileInfo(fi.path()).fileName());
if (component) {
- const QUrl url(m_archivesToDownload.first().second + suffix);
+ QString fullQueryString;
+ if (!queryString.isEmpty())
+ fullQueryString = QLatin1String("?") + queryString;
+ const QUrl url(m_archivesToDownload.first().second + suffix + fullQueryString);
const QString &scheme = url.scheme();
downloader = FileDownloaderFactory::instance().create(scheme, this);
diff --git a/src/libs/installer/downloadarchivesjob.h b/src/libs/installer/downloadarchivesjob.h
index 9cf904fae..765d2c564 100644
--- a/src/libs/installer/downloadarchivesjob.h
+++ b/src/libs/installer/downloadarchivesjob.h
@@ -91,7 +91,7 @@ protected Q_SLOTS:
void emitDownloadProgress(double progress);
private:
- KDUpdater::FileDownloader *setupDownloader(const QString &suffix = QString());
+ KDUpdater::FileDownloader *setupDownloader(const QString &suffix = QString(), const QString &queryString = QString());
private:
PackageManagerCore *m_core;