Commit 4c7c4036 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Nate Graham
Browse files

SourcesPage: Address how we show the checked state

Do not use data() as it won't refresh as the model changes, we never
actually set the checked property anyway. Just call set and let the
checked property be updated by the model.

Alternatively we had 2 actors updating the value and it didn't work
well.

BUG: 406295
parent e59bbcad
......@@ -208,7 +208,7 @@ DiscoverPage {
id: enabledBox
readonly property variant idx: sourcesView.model.index(index, 0)
readonly property variant modelChecked: sourcesView.model.data(idx, Qt.CheckStateRole)
readonly property variant modelChecked: model.checkState
checked: modelChecked !== Qt.Unchecked
enabled: sourcesView.model.flags(idx) & Qt.ItemIsUserCheckable
onClicked: {
......
......@@ -34,6 +34,7 @@ QHash<int, QByteArray> SourcesModel::roleNames() const
roles.insert(AbstractSourcesBackend::IdRole, "sourceId");
roles.insert(Qt::DisplayRole, "display");
roles.insert(Qt::ToolTipRole, "toolTip");
roles.insert(Qt::CheckStateRole, "checkState");
roles.insert(SourceNameRole, "sourceName");
roles.insert(SourcesBackend, "sourcesBackend");
roles.insert(ResourcesBackend, "resourcesBackend");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment