[Workspace Scripting] Turn "gridUnit" into a property getter function
ClosedPublic

Authored by broulik on Apr 13 2018, 2:46 PM.

Details

Summary

Avoids calling into QFontMetrics on startup for a method that is hardly used.

Test Plan

WorkspaceScripting::ScriptEngine::setupEngine consistently showed up with 1.2% on startup in QFontMetrics, now it's virtually zero.

  • Verified in scripting console that gridUnit still returns the same value it did before and that the method is not executed on startup anymore but whenever I call it from JS.
  • Created a new panel whose default height is gridUnit * 2, its size looked sane

Diff Detail

Repository
R120 Plasma Workspace
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.Apr 13 2018, 2:46 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 13 2018, 2:46 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Apr 13 2018, 2:46 PM
davidedmundson accepted this revision.Apr 13 2018, 3:17 PM
This revision is now accepted and ready to land.Apr 13 2018, 3:17 PM
This revision was automatically updated to reflect the committed changes.