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

Kai Uwe Broulik noreply at phabricator.kde.org
Fri Apr 13 14:46:08 UTC 2018


broulik created this revision.
broulik added a reviewer: Plasma.
Restricted Application added a project: Plasma.
Restricted Application added a subscriber: plasma-devel.
broulik requested review of this revision.

REVISION 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

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D12173

AFFECTED FILES
  shell/scripting/scriptengine.cpp
  shell/scripting/scriptengine_v1.cpp
  shell/scripting/scriptengine_v1.h

To: broulik, #plasma
Cc: plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180413/4ee7824f/attachment-0001.html>


More information about the Plasma-devel mailing list