Port Plasma Desktop Scripting to QJSEngine
ClosedPublic

Authored by mart on May 25 2018, 1:38 PM.

Details

Summary

Port plasma desktop scripting to qjsengine, removing every trace of QScript from plasma-workspace.
The scripting is 100% API compatible.
the bindings are partly done on the javascript part as some things are only possible there and not on the QJSEngine part:

  • setting AppInterface as the globalobject's proto with property getters that are evaluated every time
  • setting functions that act as constructors (using newQMetaObject gives way more complex and uglier c++ code in Containment, as the scriptengine is not immediately accessible)
  • a QRectF wrapper which exposes all properties and methods that were exposed in the previous implementation
Test Plan
  • some manual api test from the interactive console
  • tested both from the desktop console and first start with some pretty complex layouts from lnf packages (the default one, netrunner, united, elpas)
  • tested every property/methos of the qrectf wrapper

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.
mart created this revision.May 25 2018, 1:38 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 25 2018, 1:38 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart requested review of this revision.May 25 2018, 1:38 PM
mart changed the visibility from "Public (No Login Required)" to "No One".May 25 2018, 1:40 PM
mart retitled this revision from first round of porting to QJSEngine to Port Plasma Desktop Scripting to QJSEngine.May 25 2018, 1:49 PM
mart edited the summary of this revision. (Show Details)
mart edited the test plan for this revision. (Show Details)
mart added a reviewer: Plasma.
mart updated this revision to Diff 34863.May 25 2018, 1:50 PM
mart edited the summary of this revision. (Show Details)

remove every QScript trace, deps--

mart changed the visibility from "No One" to "Public (No Login Required)".May 25 2018, 1:50 PM
mart updated this revision to Diff 34864.May 25 2018, 1:51 PM

proper diff

davidedmundson accepted this revision.Jun 7 2018, 2:57 PM
davidedmundson added a subscriber: davidedmundson.

+++++
Thanks for tackling a very boring and difficult task.

There are two things I'd like to see also tested:

  • the DBus wallpaper changing script that I know a bunch of people use
  • Something using executeSetupPlasmoidScript
shell/scripting/scriptengine_v1.cpp
198

I think we should add a wrapper for this error creation in ScriptEngine, it's duplicated a lot.

This revision is now accepted and ready to land.Jun 7 2018, 2:57 PM
mart added a comment.Jun 8 2018, 10:56 AM

+++++
Thanks for tackling a very boring and difficult task.

There are two things I'd like to see also tested:

  • the DBus wallpaper changing script that I know a bunch of people use

do you know where it is?

  • Something using executeSetupPlasmoidScript

for that i tried the netrunner lnf, which has custom setups for folderview and several plasmoids, all seems to be correctly rand and make proper results

Oh sorry, I meant to find one. Yep that's the script I meant.

Awesome. Ship it!

mart updated this revision to Diff 35838.Jun 8 2018, 2:14 PM
  • newError function to create JS errors
This revision was automatically updated to reflect the committed changes.