Commit 1407b82c authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by 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.


(cherry picked from commit 5365c43a)
parent 5f7350e8
...@@ -210,7 +210,7 @@ DiscoverPage { ...@@ -210,7 +210,7 @@ DiscoverPage {
readonly property variant idx: sourcesView.model.index(index, 0) readonly property variant idx: sourcesView.model.index(index, 0)
readonly property variant modelChecked: sourcesView.model.data(idx, Qt.CheckStateRole) readonly property variant modelChecked: sourcesView.model.data(idx, Qt.CheckStateRole)
checked: modelChecked !== Qt.Unchecked checked: modelChecked !== Qt.Unchecked
enabled: modelChecked !== undefined enabled: sourcesView.model.flags(idx) & Qt.ItemIsUserCheckable
onClicked: { onClicked: {
sourcesView.model.setData(idx, checkState, Qt.CheckStateRole) sourcesView.model.setData(idx, checkState, Qt.CheckStateRole)
checked = Qt.binding(function() { return modelChecked !== Qt.Unchecked; }) 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