diff options
-rw-r--r-- | Changelog | 3 | ||||
-rw-r--r-- | doc/installerfw.qdoc | 4 | ||||
-rw-r--r-- | src/libs/installer/downloadarchivesjob.cpp | 9 | ||||
-rw-r--r-- | src/libs/installer/downloadarchivesjob.h | 2 |
4 files changed, 14 insertions, 4 deletions
@@ -1,3 +1,6 @@ +1.4.1 +- Added support to pass a query string when downloading archives. (QTIFW-329) + 1.4 - Force updating of Essential components. (QTIFW-38, QTIFW-155) - Display release date in Updater and Packagemanager. (QTIFW-25) diff --git a/doc/installerfw.qdoc b/doc/installerfw.qdoc index 14aadc19c..7039fbca0 100644 --- a/doc/installerfw.qdoc +++ b/doc/installerfw.qdoc @@ -265,6 +265,10 @@ \o List of language codes to be used for translating the user interface. To add several language variants, specify several Translation sections that each specify the name of a language variant. Optional. For more information, see \l{Translating Pages}. + \row + \o UrlQueryString + \o This string needs to be in the form "key=value" and will be appended to archive download + requests. This can be used to transmit information to the webserver hosting the repository. \endtable 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; |