From d2ae9c16c3427c272d41e9a471f705ad8947a97a Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Wed, 28 Feb 2018 09:54:22 +0200 Subject: Add attribute to mark parts of install tree unstable This commit adds new AllowUnstableComponents configuration. Setting AllowUnstablecomponents to true in config.xml will * allow installing other components when there are errors in scripts * allow installing other components when there are missing dependencies * will mark the 'broken' components uninstallable in treeview Task-number: QTIFW-930 Change-Id: I8d28cf9c4b0401e0bb76795e87d581f39b64f128 Reviewed-by: Iikka Eklund --- src/libs/installer/componentmodel.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libs/installer/componentmodel.cpp') diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp index 0f8a47c38..078afc50a 100644 --- a/src/libs/installer/componentmodel.cpp +++ b/src/libs/installer/componentmodel.cpp @@ -222,14 +222,15 @@ QVariant ComponentModel::data(const QModelIndex &index, int role) const return component->data(Qt::UserRole + index.column()); } if (role == Qt::CheckStateRole) { - if (!component->isCheckable()) - return QVariant(); - if (!component->autoDependencies().isEmpty()) + if (!component->isCheckable() || !component->autoDependencies().isEmpty() || component->isUnstable()) return QVariant(); } if (role == ComponentModelHelper::ExpandedByDefault) { return component->isExpandedByDefault(); } + if (component->isUnstable() && role == Qt::ForegroundRole) { + return QVariant(QColor(Qt::lightGray)); + } return component->data(role); } return QVariant(); -- cgit v1.2.3