[kcmkwin/kwinrules] Create RulesModel on demand
Changes PlannedPublic

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

Details

Reviewers
iasensio
Group Reviewers
KWin
Summary

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

Repository
R108 KWin
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.May 15 2020, 1:43 PM
Restricted Application added a project: KWin. · View Herald TranscriptMay 15 2020, 1:43 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
broulik requested review of this revision.May 15 2020, 1:43 PM
broulik edited the summary of this revision. (Show Details)May 15 2020, 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)

kcmkwin/kwinrules/rulesmodel.cpp
47

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.May 15 2020, 8:43 PM
broulik added inline comments.
kcmkwin/kwinrules/rulesmodel.cpp
47

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