Fix KWin decoration KCM showing correct index at startup
ClosedPublic

Authored by davidedmundson on Apr 11 2017, 5:04 PM.

Details

Summary

The KCM has a context property of the currently set theme index. This is
set before the decorations model is populated, so it is currently always
-1.

This model is populated after the constructor but before
KCModule::load().

KCModule::load is called from KCModule::showEvent so before
QQuickGridView will start doing anything with delegates.

This fixes the problem simply and also avoid parsing the config file
multiple times.

This bug was introduced in 5.9.4:

Someone made a (tested) change to make sure the view scrolled to the
right place on startup.
I then made a (tested) commit fixing the crash on exit
The author then updated his patch to my changes, but now in a way that
didn't work.

Test Plan

Opened system settings module with a million decorations.
The correct entry was visible and highlighted.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Apr 11 2017, 5:04 PM
Restricted Application added a project: KWin. · View Herald TranscriptApr 11 2017, 5:04 PM
Restricted Application added subscribers: KWin, kwin, plasma-devel. · View Herald Transcript
graesslin accepted this revision.Apr 11 2017, 5:58 PM
This revision is now accepted and ready to land.Apr 11 2017, 5:58 PM
This revision was automatically updated to reflect the committed changes.