summaryrefslogtreecommitdiffstats
path: root/installerbuilder/libinstaller/getrepositorymetainfojob.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@nokia.com>2011-11-25 14:30:24 +0100
committerKarsten Heimrich <karsten.heimrich@nokia.com>2011-11-28 13:15:07 +0100
commite7666985a46e40ff6569c4bc2f0e96987c5ab622 (patch)
treec3ba15abdae5bc7591f011c195627940c09c7f08 /installerbuilder/libinstaller/getrepositorymetainfojob.cpp
parent995ea7db1801925d63e94d3c196bd60d5b40134b (diff)
Add authentication support to the downloaders.
Change-Id: If2317d5aded40819f62fa942b3a8af53c954689c Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder/libinstaller/getrepositorymetainfojob.cpp')
-rw-r--r--installerbuilder/libinstaller/getrepositorymetainfojob.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/installerbuilder/libinstaller/getrepositorymetainfojob.cpp b/installerbuilder/libinstaller/getrepositorymetainfojob.cpp
index ba7e1574a..fc6cce5b5 100644
--- a/installerbuilder/libinstaller/getrepositorymetainfojob.cpp
+++ b/installerbuilder/libinstaller/getrepositorymetainfojob.cpp
@@ -49,6 +49,8 @@
#include <QtGui/QMessageBox>
+#include <QtNetwork/QAuthenticator>
+
#include <QtXml/QDomDocument>
#include <QtXml/QDomElement>
@@ -212,6 +214,11 @@ void GetRepositoryMetaInfoJob::startUpdatesXmlDownload()
m_downloader->setUrl(QUrl(url.toString() + QString(QLatin1String("/Updates.xml?")).append(
QString::number(qrand() * qrand()))));
+ QAuthenticator auth;
+ auth.setUser(m_repository.username());
+ auth.setPassword(m_repository.password());
+ m_downloader->setAuthenticator(auth);
+
m_downloader->setAutoRemoveDownloadedFile(false);
connect(m_downloader, SIGNAL(downloadCompleted()), this, SLOT(updatesXmlDownloadFinished()));
connect(m_downloader, SIGNAL(downloadCanceled()), this, SLOT(updatesXmlDownloadCanceled()));
@@ -380,6 +387,11 @@ void GetRepositoryMetaInfoJob::fetchNextMetaInfo()
m_downloader->setUrl(url);
m_downloader->setAutoRemoveDownloadedFile(true);
+ QAuthenticator auth;
+ auth.setUser(m_repository.username());
+ auth.setPassword(m_repository.password());
+ m_downloader->setAuthenticator(auth);
+
connect(m_downloader, SIGNAL(downloadCanceled()), this, SLOT(metaDownloadCanceled()));
connect(m_downloader, SIGNAL(downloadCompleted()), this, SLOT(metaDownloadFinished()));
connect(m_downloader, SIGNAL(downloadAborted(QString)), this, SLOT(metaDownloadError(QString)),