diff options
author | Alexander Lenhardt <alexander.lenhardt@nokia.com> | 2011-10-13 13:50:57 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2011-10-13 15:15:25 +0200 |
commit | 7c6aa97c761630ced0e00e733d4f9e49c68071f6 (patch) | |
tree | 34a1366a062c6b811c0caee17eb338db9d39059d /installerbuilder | |
parent | ef5cd8a882c19dac92cd936cb6faf21715fb5acc (diff) |
added scRemoteVersion constant for better readability
Change-Id: I781f58c74e318d0946026f691cb381634fd59704
Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder')
-rw-r--r-- | installerbuilder/libinstaller/component.cpp | 4 | ||||
-rw-r--r-- | installerbuilder/libinstaller/constants.h | 1 | ||||
-rw-r--r-- | installerbuilder/libinstaller/getrepositorymetainfojob.cpp | 2 | ||||
-rw-r--r-- | installerbuilder/libinstaller/packagemanagercore.cpp | 7 | ||||
-rw-r--r-- | installerbuilder/libinstaller/updater.cpp | 2 |
5 files changed, 9 insertions, 7 deletions
diff --git a/installerbuilder/libinstaller/component.cpp b/installerbuilder/libinstaller/component.cpp index 0477ff2f9..fb0f7d8b4 100644 --- a/installerbuilder/libinstaller/component.cpp +++ b/installerbuilder/libinstaller/component.cpp @@ -143,7 +143,7 @@ void Component::loadDataFromPackage(const Package &package) setValue(scAutoDependOn, package.data(scAutoDependOn).toString()); setValue(scCompressedSize, QString::number(package.compressedSize())); setValue(scUncompressedSize, QString::number(package.uncompressedSize())); - setValue(scVersion, package.data(scVersion).toString()); + setValue(scRemoteVersion, package.data(scRemoteVersion).toString()); setValue(scInheritVersion, package.data(scInheritVersion).toString()); setValue(scDependencies, package.data(scDependencies).toString()); setValue(scVirtual, package.data(scVirtual).toString()); @@ -662,7 +662,7 @@ void Component::addDownloadableArchive(const QString &path) { Q_ASSERT(isFromOnlineRepository()); - const QString versionPrefix = value(scVersion); + const QString versionPrefix = value(scRemoteVersion); verbose() << "addDownloadable " << path << std::endl; d->m_downloadableArchives.append(versionPrefix + path); } diff --git a/installerbuilder/libinstaller/constants.h b/installerbuilder/libinstaller/constants.h index 26baa21c5..b42da114d 100644 --- a/installerbuilder/libinstaller/constants.h +++ b/installerbuilder/libinstaller/constants.h @@ -36,6 +36,7 @@ static const QLatin1String scFalse("false"); static const QLatin1String scName("Name"); static const QLatin1String scVersion("Version"); +static const QLatin1String scRemoteVersion("Version"); static const QLatin1String scDisplayVersion("DisplayVersion"); static const QLatin1String scRemoteDisplayVersion("RemoteDisplayVersion"); static const QLatin1String scInheritVersion("inheritVersionFrom"); diff --git a/installerbuilder/libinstaller/getrepositorymetainfojob.cpp b/installerbuilder/libinstaller/getrepositorymetainfojob.cpp index ebc584ea7..1313472b9 100644 --- a/installerbuilder/libinstaller/getrepositorymetainfojob.cpp +++ b/installerbuilder/libinstaller/getrepositorymetainfojob.cpp @@ -283,7 +283,7 @@ void GetRepositoryMetaInfoJob::updatesXmlDownloadFinished() for (int j = 0; j < c2.count(); ++j) if (c2.at(j).toElement().tagName() == scName) m_packageNames << c2.at(j).toElement().text(); - else if (c2.at(j).toElement().tagName() == scVersion) + else if (c2.at(j).toElement().tagName() == scRemoteVersion) m_packageVersions << c2.at(j).toElement().text(); else if (c2.at(j).toElement().tagName() == QLatin1String("SHA1")) m_packageHash << c2.at(j).toElement().text(); diff --git a/installerbuilder/libinstaller/packagemanagercore.cpp b/installerbuilder/libinstaller/packagemanagercore.cpp index 32118d07a..f1aa210fc 100644 --- a/installerbuilder/libinstaller/packagemanagercore.cpp +++ b/installerbuilder/libinstaller/packagemanagercore.cpp @@ -92,6 +92,7 @@ static bool componentMatches(const Component *component, const QString &name, if (version.isEmpty()) return true; + // can be remote or local version return PackageManagerCore::versionMatches(component->value(scVersion), version); } @@ -1499,7 +1500,7 @@ bool PackageManagerCore::updateComponentData(struct Data &data, Component *compo // mark the replacement as installed only in package manager mode, otherwise // it would not show up in the updaters component list component->setInstalled(); - component->setValue(scInstalledVersion, data.package->data(scVersion).toString()); + component->setValue(scInstalledVersion, data.package->data(scRemoteVersion).toString()); } data.replacementToExchangeables.insert(component, componentsToReplace); break; // break as soon as we know we replace at least one other component @@ -1658,7 +1659,7 @@ bool PackageManagerCore::fetchUpdaterPackages(const PackagesList &remotes, const continue; // Update for not installed package found, skip it. const LocalPackage &localPackage = locals.value(name); - const QString updateVersion = update->data(scVersion).toString(); + const QString updateVersion = update->data(scRemoteVersion).toString(); if (KDUpdater::compareVersion(updateVersion, localPackage.version) <= 0) continue; @@ -1779,7 +1780,7 @@ QString PackageManagerCore::findDisplayVersion(const QString &componentName, if (replaceWith.isEmpty()) { if (components.value(componentName)->isInstalled()) return components.value(componentName)->value(scInstalledVersion); - return components.value(componentName)->value(scVersion); + return components.value(componentName)->value(scVersion); // can be remote or local version } if (visited.contains(replaceWith)) // cycle return QString(); diff --git a/installerbuilder/libinstaller/updater.cpp b/installerbuilder/libinstaller/updater.cpp index 47b0d1933..c0f474c93 100644 --- a/installerbuilder/libinstaller/updater.cpp +++ b/installerbuilder/libinstaller/updater.cpp @@ -90,7 +90,7 @@ bool Updater::checkForUpdates() for (it = components.begin(); it != components.end(); ++it) { QDomElement update = doc.createElement(QLatin1String("update")); update.setAttribute(QLatin1String("name"), (*it)->value(scDisplayName)); - update.setAttribute(QLatin1String("version"), (*it)->value(scVersion)); + update.setAttribute(QLatin1String("version"), (*it)->value(scRemoteVersion)); update.setAttribute(QLatin1String("size"), (*it)->value(scUncompressedSize)); root.appendChild(update); } |