Unverified Commit 1e644e57 authored by David Rosca's avatar David Rosca
Browse files

KCM: Show only available device profiles

CCBUG: 365723

Differential Revision: https://phabricator.kde.org/D10148
parent f5c2a04e
......@@ -23,6 +23,7 @@ import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.private.volume 0.1
ColumnLayout {
id: delegate
......@@ -53,14 +54,15 @@ ColumnLayout {
}
ComboBox {
Layout.fillWidth: true
model: Profiles
model: Profiles.filter(function (profile) {
return profile.availability === Profile.Available;
})
// NOTE: model resets (i.e. profiles property changes) will reset
// the currentIndex, so force it to be set on model changes, otherwise
// it would eventually become 0 when it shouldn't be.
onModelChanged: currentIndex = ActiveProfileIndex
onModelChanged: currentIndex = model.indexOf(Profiles[ActiveProfileIndex])
textRole: "description"
currentIndex: ActiveProfileIndex
onActivated: ActiveProfileIndex = index
onActivated: ActiveProfileIndex = Profiles.indexOf(model[index])
}
}
......
Supports Markdown
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