diff options
author | kh1 <qt-info@nokia.com> | 2011-06-08 12:01:27 +0200 |
---|---|---|
committer | kh1 <qt-info@nokia.com> | 2011-06-08 12:01:27 +0200 |
commit | 826e263f06d37514e38b3cf1d872a85e28cb4a61 (patch) | |
tree | 199ac3a32810b99c16e6a24d14a74000ba32f87e | |
parent | e451c7ffe74bd181ceec8ac536223ef49a16e8a1 (diff) |
We need to resolve updater components in a different way.
Since we store possible dependencies in the private class,
we need to check there for existance as well.
-rw-r--r-- | installerbuilder/libinstaller/qinstaller.cpp | 34 | ||||
-rw-r--r-- | installerbuilder/libinstaller/qinstaller.h | 2 |
2 files changed, 19 insertions, 17 deletions
diff --git a/installerbuilder/libinstaller/qinstaller.cpp b/installerbuilder/libinstaller/qinstaller.cpp index e489f3f0d..ef249dc0a 100644 --- a/installerbuilder/libinstaller/qinstaller.cpp +++ b/installerbuilder/libinstaller/qinstaller.cpp @@ -110,8 +110,8 @@ static bool componentMatches(const Component *component, const QString &name, return Installer::versionMatches(component->value(QLatin1String("Version")), version); } -static Component* subComponentByName(const Installer *installer, const QString &name, - const QString &version = QString(), Component *check = 0) +Component* Installer::subComponentByName(const QInstaller::Installer *installer, const QString &name, + const QString &version, Component *check) { if (name.isEmpty()) return 0; @@ -119,22 +119,22 @@ static Component* subComponentByName(const Installer *installer, const QString & if (check != 0 && componentMatches(check, name, version)) return check; - const QList<Component*> rootComponents = check == 0 ? installer->components(false, AllMode) - : check->childComponents(false, AllMode); - foreach (QInstaller::Component* component, rootComponents) { - Component* const result = subComponentByName(installer, name, version, component); - if (result != 0) - return result; - } - - const QList<Component*> updaterComponents = check == 0 - ? installer->components(false, UpdaterMode) : check->childComponents(false, UpdaterMode); - foreach (QInstaller::Component* component, updaterComponents) { - Component* const result = subComponentByName(installer, name, version, component); - if (result != 0) - return result; + if (installer->runMode() == AllMode) { + const QList<Component*> rootComponents = check == 0 ? installer->components(false, AllMode) + : check->childComponents(false, AllMode); + foreach (QInstaller::Component* component, rootComponents) { + Component* const result = subComponentByName(installer, name, version, component); + if (result != 0) + return result; + } + } else { + const QList<Component*> updaterComponents = installer->components(false, UpdaterMode) + + installer->d->m_updaterComponentsDeps; + foreach (QInstaller::Component *component, updaterComponents) { + if (componentMatches(component, name, version)) + return component; + } } - return 0; } diff --git a/installerbuilder/libinstaller/qinstaller.h b/installerbuilder/libinstaller/qinstaller.h index db17373c4..9b161e862 100644 --- a/installerbuilder/libinstaller/qinstaller.h +++ b/installerbuilder/libinstaller/qinstaller.h @@ -279,6 +279,8 @@ private: QHash<QString, KDUpdater::PackageInfo> *installedPackages; }; bool updateComponentData(const struct Data &data, QInstaller::Component *component); + static Component *subComponentByName(const QInstaller::Installer *installer, const QString &name, + const QString &version = QString(), Component *check = 0); private: InstallerPrivate* const d; |