summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@digia.com>2013-09-27 11:59:15 +0200
committerTim Jenssen <tim.jenssen@digia.com>2013-09-30 13:31:44 +0200
commit5d8197d3d2d1f36be5046851f22c281e61fb74e9 (patch)
treeb8232f1ea93d8d359c58d65d9cafd1480b28343a /src
parent047844cddf143ecfddac90040eecd966f2e20b65 (diff)
fix that setTemRepository added child repos to the default ones
Task-number: QTIFW-373 Change-Id: I30646ef084d9ec6f3a393992a9c96e1f77dbf3d9 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/libs/installer/getrepositorymetainfojob.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/libs/installer/getrepositorymetainfojob.cpp b/src/libs/installer/getrepositorymetainfojob.cpp
index 2fd167a4a..b163b5e15 100644
--- a/src/libs/installer/getrepositorymetainfojob.cpp
+++ b/src/libs/installer/getrepositorymetainfojob.cpp
@@ -318,7 +318,28 @@ void GetRepositoryMetaInfoJob::updatesXmlDownloadFinished()
}
if (!repositoryUpdates.isEmpty()) {
- if (m_core->settings().updateDefaultRepositories(repositoryUpdates) == Settings::UpdatesApplied) {
+ const QSet<Repository> temporaries = m_core->settings().temporaryRepositories();
+ // in case the temp repository introduced something new, we only want that temporary
+ if (temporaries.contains(m_repository)) {
+
+ QSet<Repository> childTempRepositories;
+ typedef QPair<Repository, Repository> RepositoryPair;
+
+ QList<RepositoryPair> values = repositoryUpdates.values(QLatin1String("add"));
+ foreach (const RepositoryPair &value, values)
+ childTempRepositories.insert(value.first);
+
+ values = repositoryUpdates.values(QLatin1String("replace"));
+ foreach (const RepositoryPair &value, values)
+ childTempRepositories.insert(value.first);
+
+ QSet<Repository> newChildTempRepositories = childTempRepositories.subtract(temporaries);
+ if (newChildTempRepositories.count() > 0) {
+ m_core->settings().addTemporaryRepositories(newChildTempRepositories, true);
+ finished(QInstaller::RepositoryUpdatesReceived, tr("Repository updates received."));
+ return;
+ }
+ } else if (m_core->settings().updateDefaultRepositories(repositoryUpdates) == Settings::UpdatesApplied) {
if (m_core->isUpdater() || m_core->isPackageManager())
m_core->writeMaintenanceConfigFiles();
finished(QInstaller::RepositoryUpdatesReceived, tr("Repository updates received."));