[kcmkwin/kwinrules] Create RulesModel on demand
Changes PlannedPublic

Authored by broulik on Fri, May 15, 1:43 PM.


Group Reviewers

Creating it is quite heavy and not needed for showing the overview.

CCBUG: 421564

Test Plan
  • KCM loads noticeably faster but still spends like 20% of time in "retranslate" :/
  • Can still edit and save rules

Diff Detail

R108 KWin
Lint Skipped
Unit Tests Skipped
broulik created this revision.Fri, May 15, 1:43 PM
Restricted Application added a project: KWin. · View Herald TranscriptFri, May 15, 1:43 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
broulik requested review of this revision.Fri, May 15, 1:43 PM
broulik edited the summary of this revision. (Show Details)Fri, May 15, 2:15 PM
broulik edited the test plan for this revision. (Show Details)

With ~20 rules I still can see a noticeable lag, although it's slightly better.

I think the main time consuming operation is the conversion between RuleSettings and Rules objects.
This happens in two interfaces, once on general loading/saving: RuleBookSettings->rules(), and the other on editing/saving a specific rule.
I'd like to try handling RuleSettings objects directly to see if it reduces the loading/editing times.

About this particular improvement, I'd also like to go for it but there is the problem of where to register the qml types.
Would a specific file guarded by #ifdef work to execute this lines depending on the executable?
kwin_rules_dialog (launching from the appmenu) needs a full re-write anyway, since it's a QML/QWidget frankestein and also doesn't work on wayland (https://bugs.kde.org/show_bug.cgi?id=421405)


There is a problem moving this out of here, in that kwin_rules_dialog executable will not find it.

broulik planned changes to this revision.Fri, May 15, 8:43 PM
broulik added inline comments.

Ah, i was already wondering why it was here :/