diff options
author | Katja Marttila <katja.marttila@qt.io> | 2018-05-17 09:07:17 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2018-06-01 07:48:10 +0000 |
commit | 88d85a78949194aafa67340d3afdbc90594f9064 (patch) | |
tree | 513308bb8eb150a58ae65947f9479febed9cc806 /src/libs/installer/component.cpp | |
parent | e408037e224c8e362c0bbfc39978705f9b14f03f (diff) |
Fix select state for unstable components
In updater mode, unstable components needs to be unselected so that
those won't be updated. In packagemanager mode, installed unstable
components needs to be in checked state so that those won't be
uninstalled.
Change-Id: Ib3d16ae8c0eec4e07731a0082c02fd710ffdb9d6
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'src/libs/installer/component.cpp')
-rw-r--r-- | src/libs/installer/component.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index 65dfbbc8d..feedad737 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -1032,7 +1032,15 @@ Operation *Component::createOperation(const QString &operationName, const QStrin void Component::markComponentUnstable() { setValue(scDefault, scFalse); - setCheckState(Qt::Unchecked); + // Mark unstable component unchecked if: + // 1. Installer, so the unstable component won't be installed + // 2. Maintenancetool, when component is not installed. + // 3. Updater, we don't want to update unstable components + // Mark unstable component checked if: + // 1. Maintenancetool, if component is installed and + // unstable so it won't get uninstalled. + if (d->m_core->isInstaller() || !isInstalled() || d->m_core->isUpdater()) + setCheckState(Qt::Unchecked); setValue(scUnstable, scTrue); } @@ -1335,7 +1343,7 @@ void Component::setUpdateAvailable(bool isUpdateAvailable) */ bool Component::updateRequested() { - return d->m_updateIsAvailable && isSelected(); + return d->m_updateIsAvailable && isSelected() && !isUnstable(); } /*! |