summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-07-29 15:27:51 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2013-07-30 11:42:52 +0200
commitd4642f3ff2b73f7308938996b6ba15d59f6a5169 (patch)
tree84a43803efd9a2b860a80931685ab89a768417ff
parentd13bd1f242ca9b2bd440a6c03784d405e5cd11de (diff)
Fix update component selection shows wrong package sizes.
Task-number: QTIFW-302 During the update of KdTools we removed a bit to much code, so the compressed/ uncompressed size was never passed to the component. Now we keep and set it properly again. Force an update of the uncompressed component size once we have calculated all checked components. Change-Id: I12a796b543bbacdef4fbbdac10ff1103612c4c61 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
-rw-r--r--src/libs/installer/component.cpp4
-rw-r--r--src/libs/installer/componentmodel.cpp4
-rw-r--r--src/libs/kdtools/kdupdaterupdatesinfo.cpp3
3 files changed, 9 insertions, 2 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index 79347d12b..f2f452fdf 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -275,8 +275,8 @@ void Component::loadDataFromPackage(const Package &package)
setValue(scDescription, package.data(scDescription).toString());
setValue(scDefault, package.data(scDefault).toString());
setValue(scAutoDependOn, package.data(scAutoDependOn).toString());
- setValue(scCompressedSize, QString::number(0));
- setValue(scUncompressedSize, QString::number(0));
+ setValue(scCompressedSize, package.data(scCompressedSize).toString());
+ setValue(scUncompressedSize, package.data(scUncompressedSize).toString());
setValue(scRemoteVersion, package.data(scRemoteVersion).toString());
setValue(scInheritVersion, package.data(scInheritVersion).toString());
setValue(scDependencies, package.data(scDependencies).toString());
diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp
index f65611ffe..8005a3533 100644
--- a/src/libs/installer/componentmodel.cpp
+++ b/src/libs/installer/componentmodel.cpp
@@ -398,6 +398,10 @@ void ComponentModel::slotModelReset()
m_initialCheckedState[component->checkState()].insert(component);
}
+ // update all checked components uncompressed size (important for nodes)
+ foreach (QInstaller::Component *component, checked)
+ component->updateUncompressedSize();
+
m_currentCheckedState = m_initialCheckedState;
updateAndEmitModelState(); // update the internal state
}
diff --git a/src/libs/kdtools/kdupdaterupdatesinfo.cpp b/src/libs/kdtools/kdupdaterupdatesinfo.cpp
index 9e6f35aac..27c21fb19 100644
--- a/src/libs/kdtools/kdupdaterupdatesinfo.cpp
+++ b/src/libs/kdtools/kdupdaterupdatesinfo.cpp
@@ -155,6 +155,9 @@ bool UpdatesInfoData::parsePackageUpdateElement(const QDomElement &updateE)
// overwrite default if we have a language specific description
if (languageAttribute == QLocale().name().toLower())
info.data[childE.tagName()] = childE.text();
+ } else if (childE.tagName() == QLatin1String("UpdateFile")) {
+ info.data[QLatin1String("CompressedSize")] = childE.attribute(QLatin1String("CompressedSize"));
+ info.data[QLatin1String("UncompressedSize")] = childE.attribute(QLatin1String("UncompressedSize"));
} else {
info.data[childE.tagName()] = childE.text();
}