Commit e5ef7ea3 authored by David Edmundson's avatar David Edmundson
Browse files

[kcms/feedback] Fix slider value

If the kcm's property changes externally we don't update the slider
after the initial load, which is before KConfigModule::load which actually sets
the property.

Whilst there is an alternative fix calling load() a second time, we need
this anyway for default and reset buttons to work correctly.

I also think the original code was broken, I don't see why we would map
the value back to modeOptions[idx], we want the slider value to be the
index of the array, not the enum value. They just happen to be the same.

Test Plan: Opened KCM changed it, opened KCM repeat

Reviewers: #plasma, ngraham

Reviewed By: ngraham

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent 4cb2eae9
......@@ -89,9 +89,11 @@ SimpleKCM {
return null;
Component.onCompleted: {
var idx = findIndex(modeOptions, kcm.plasmaFeedbackLevel)
value = idx===null ? 2 : modeOptions[idx]
Connections {
target: kcm
onPlasmaFeedbackLevelChanged: {
statisticsModeSlider.value = statisticsModeSlider.findIndex(statisticsModeSlider.modeOptions, kcm.plasmaFeedbackLevel)
onMoved: {
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