[scripting] Fix effect.animate() curve argument being actually used
ClosedPublic

Authored by davidedmundson on Aug 7 2018, 10:30 AM.

Details

Summary

One cannot use a non metatype frrom an external class inside an
invokable. https://bugreports.qt.io/browse/QTBUG-58454

End result is the script engine arguments wouldn't match up and MOC
would just use the default value.

As far as I can tell this has been broken for 6 years.
The global animate method that unboxes a QJSValue as an object is
unaffected.
No shipped kwin effect actually used it.

To some extent we didn't even actually want to enforce the enum as we
also accept custom value of ScriptedEffect::GuassianCurve, so it has
been switched for an int.

(Note: This is against the current QtScript engine not the QJSEngine
port. I want to merge this first so that we have compatiable tests
first)

Test Plan

Unit test

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Aug 7 2018, 10:30 AM
Restricted Application added a project: KWin. · View Herald TranscriptAug 7 2018, 10:30 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Aug 7 2018, 10:30 AM
broulik accepted this revision.Aug 7 2018, 11:28 AM
This revision is now accepted and ready to land.Aug 7 2018, 11:28 AM
This revision was automatically updated to reflect the committed changes.