diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2021-08-04 11:17:41 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2021-08-16 12:48:21 +0300 |
commit | a89e9e2917f0e783ced39769b879b0f4c53e144a (patch) | |
tree | f19dc19205d61ebe1d75c4d5349afaeb5006fd7f /src/libs/installer/component.cpp | |
parent | 711a412f52667d90aa49891e6b8207e548f33463 (diff) |
MT: Hide superfluous size information when running as package manager
As the uncompressed size is only checked for already installed and new
component selections (+ dependencies), it makes sense to show the size
information for only these components in the ComponentSelectionPage
"Size" column.
This makes it easier to follow how the component selection affects
installation size.
Task-number: QTIFW-2293
Change-Id: Ic8feb505534a1726b6b3296eda7e1ae824292ece
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/component.cpp')
-rw-r--r-- | src/libs/installer/component.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index 0a768cd7f..d50c36c61 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -375,16 +375,20 @@ quint64 Component::updateUncompressedSize() { quint64 size = 0; - if (installAction() == ComponentModelHelper::Install - || installAction() == ComponentModelHelper::KeepInstalled) { + const bool installOrKeepInstalled = (installAction() == ComponentModelHelper::Install + || installAction() == ComponentModelHelper::KeepInstalled); + + if (installOrKeepInstalled) size = d->m_vars.value(scUncompressedSize).toLongLong(); - } foreach (Component* comp, d->m_allChildComponents) size += comp->updateUncompressedSize(); setValue(scUncompressedSizeSum, QString::number(size)); - setData(humanReadableSize(size), UncompressedSize); + if (size == 0 && !installOrKeepInstalled) + setData(QVariant(), UncompressedSize); + else + setData(humanReadableSize(size), UncompressedSize); return size; } |