Commit 5365c43a authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

SourcesPage: Use ItemIsUserCheckable to check if a source is checkable

We use it to disable the control if it's not, this way the backend can
support to tell the state but not allow interaction.
parent c3f27139
......@@ -210,7 +210,7 @@ DiscoverPage {
readonly property variant idx: sourcesView.model.index(index, 0)
readonly property variant modelChecked: sourcesView.model.data(idx, Qt.CheckStateRole)
checked: modelChecked !== Qt.Unchecked
enabled: modelChecked !== undefined
enabled: sourcesView.model.flags(idx) & Qt.ItemIsUserCheckable
onClicked: {
sourcesView.model.setData(idx, checkState, Qt.CheckStateRole)
checked = Qt.binding(function() { return modelChecked !== Qt.Unchecked; })
......
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