Select correct index without timer
ClosedPublic

Authored by mart on Nov 28 2016, 12:03 PM.

Details

Summary
remove the timer that selects the index at startup
that caused flickering and things moving around since
index 0 got selected, then moved to the correct one only after a while.

unfortunately there is not a place (a signal) that says
"the view has been correctly instanced from the model" that
would be where selecting the current index at startup would be the safest.
a place that seems working correctly is on listview onCountChanged

this has to introduce KCMLookandFeel::selectedPluginIndex
that isn't very pretty, but the flickering seems to be gone and
the kcm loads from the correct place of the view from the first
frame is displayed
Test Plan

he flickering seems to be gone and the kcm loads from the correct place of the view from the first frame is displayed. Once this is in the final form, some other config dialogs need the same treatment: plasma theme and wallpapers

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart updated this revision to Diff 8564.Nov 28 2016, 12:03 PM
mart retitled this revision from to Select correct index without timer.
mart updated this object.
mart edited the test plan for this revision. (Show Details)
mart added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptNov 28 2016, 12:03 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson accepted this revision.Nov 28 2016, 12:23 PM
davidedmundson added a reviewer: davidedmundson.
davidedmundson added a subscriber: davidedmundson.

Is this just a manifest of us populating the model in KCMLookandFeel::load which is after setSource?

This revision is now accepted and ready to land.Nov 28 2016, 12:23 PM
mart added a comment.Nov 28 2016, 1:06 PM

Is this just a manifest of us populating the model in KCMLookandFeel::load which is after setSource?

I tried to add a load() in kcmutils/KCModuleQml just before loading the qml file, but even in that case assigning currentIndex: in the declaration of the GridView but doesn't seem to be enough, the only place where it's working seems to be onCountChanged even in that case.
Same thing if i add load() in the l&f kcm constructor.

This revision was automatically updated to reflect the committed changes.