[KColorSchemeManager] Optimize preview generation
ClosedPublic

Authored by broulik on Jul 18 2019, 1:16 PM.

Details

Summary

Create them only on-demand (e.g. when the menu opens or the DecorationRole is queried)
and also use KConfig::SimpleConfig as we're passing in an absolute file path anyway.

Test Plan

On Kate startup KColorSchemeManager went from 12% cost to 2.6% and saves around 40ms Kate startup time for me.
Previews are still generated properly when I enter the menu. A QComboBox using the model still gets its
previews generated when it reads the DecorationRole

Diff Detail

Repository
R265 KConfigWidgets
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Jul 18 2019, 1:16 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 18 2019, 1:16 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Jul 18 2019, 1:16 PM
ngraham accepted this revision.Aug 1 2019, 10:15 PM
This revision is now accepted and ready to land.Aug 1 2019, 10:15 PM
This revision was automatically updated to reflect the committed changes.