diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-11-22 15:33:17 +0200 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-11-24 11:27:31 +0200 |
commit | 0f261598201698f73cf28541294b5027455d0f76 (patch) | |
tree | 19d30426eba67bdfa793e47b1f3108694e017674 /src/libs | |
parent | 69c9407d7fb7bafebf5e5b8de9ca98c31a14520c (diff) |
Fix updater view behavior for non-checkable components
As the components can still be selected with the selection buttons
above the view, it makes little sense to artificially limit selecting
individual items for update and hiding their check state. Also the
documented use case for the property - making a parent component
non-checkable so only some of its children should be checked - does
not apply for the updater view.
Apply similar fix to forced installation components, which should
be also toggleable for updates.
Task-number: QTIFW-836
Change-Id: I18f34c4e8ee1e24e761e50edd3066ec4aea3432e
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/installer/component.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index 37abcea8a..e045d7f29 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -463,12 +463,14 @@ void Component::setValue(const QString &key, const QString &value) if (key == scName) d->m_componentName = normalizedValue; - if (key == scCheckable) - this->setCheckable(normalizedValue.toLower() == scTrue); + if (key == scCheckable) // Non-checkable components can still be toggled in updater + this->setCheckable(normalizedValue.toLower() == scTrue || d->m_core->isUpdater()); if (key == scExpandedByDefault) this->setExpandedByDefault(normalizedValue.toLower() == scTrue); if (key == scForcedInstallation) { - if (value == scTrue && !PackageManagerCore::noForceInstallation()) { + if (value == scTrue && !d->m_core->isUpdater() && !PackageManagerCore::noForceInstallation()) { + // Forced installation components can still be toggled in updater or when + // core is set to ignore forced installations. setCheckable(false); setCheckState(Qt::Checked); } |