diff options
author | Alexander Lenhardt <alexander.lenhardt@nokia.com> | 2012-01-05 15:18:16 +0100 |
---|---|---|
committer | Alexander Lenhardt <alexander.lenhardt@nokia.com> | 2012-01-05 17:25:25 +0100 |
commit | 3fee266f5ce102f26a5a20de9946bc2e0c947497 (patch) | |
tree | df62b824c1af7e5558fb1f507399b0e9e907e490 /installerbuilder/libinstaller/component.cpp | |
parent | a9797dbc73d0cd61c550f9ccabde8ed1a34ed956 (diff) |
fixed QTIFW-75
Change-Id: I012819b8e95aa47d08576765eaeffaef01eeaabf
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder/libinstaller/component.cpp')
-rw-r--r-- | installerbuilder/libinstaller/component.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/installerbuilder/libinstaller/component.cpp b/installerbuilder/libinstaller/component.cpp index 03e1ed335..e64bf24b8 100644 --- a/installerbuilder/libinstaller/component.cpp +++ b/installerbuilder/libinstaller/component.cpp @@ -184,9 +184,25 @@ void Component::loadDataFromPackage(const Package &package) loadLicenses(QString::fromLatin1("%1/%2/").arg(localTempPath(), name()), licenseHash); } +quint64 Component::updateUncompressedSize() +{ + quint64 size = 0; + + if (isSelected()) + size = (quint64)value(scUncompressedSize).toDouble(); + + foreach (Component* comp, d->m_allChildComponents) + size += comp->updateUncompressedSize(); + + setValue(scUncompressedSizeSum, QString::number(size)); + setData(uncompressedSize(), UncompressedSize); + + return size; +} + QString Component::uncompressedSize() const { - double size = value(scUncompressedSize).toDouble(); + double size = value(scUncompressedSizeSum).toDouble(); if (size < 1000.0) return tr("%L1 Bytes").arg(size); size /= 1024.0; @@ -196,6 +212,7 @@ QString Component::uncompressedSize() const if (size < 1000.0) return tr("%L1 MBytes").arg(size, 0, 'f', 2); size /= 1024.0; + return tr("%L1 GBytes").arg(size, 0, 'f', 2); } |