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