GNOME Bugzilla – Bug 727370
Add READWRITE, STATIC_STRINGS, etc. to GObject.ParamFlags
Last modified: 2015-10-27 22:43:20 UTC
This makes it possible to write GObject.ParamFlags.READWRITE and other friends who are not strictly speaking in the ParamFlags enumeration. Note. This is broken until #687615 is fixed, because GObject.PARAM_READWRITE has the wrong value. On the other hand, this will be obsolete if the patch in #726037 is committed, however in that case the changes to the test case should still be committed.
Created attachment 273312 [details] [review] Patch (currently broken!) This patch should work when one of the abovementioned bugs is solved.
Review of attachment 273312 [details] [review]: Yeah, makes sense. I thought Emmanuele wanted to fix GParamFlags at some point, but for now this is fine.
Btw, if you don't want to wait for proper PARAM_READWRITE (unlikely to happen because I don't know how complex the parser in g-i will get), you can just | the two flags in JS.
Basically near the top of every GJS file I write is this line: GObject.ParamFlags.READWRITE = GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE; ;-)
Looks like #726037 has been committed, so this patch is mostly obsolete - READWRITE should show up automatically when using GLib 2.42. The changes to the test cases are still relevant though.
Comment on attachment 273312 [details] [review] Patch (currently broken!) Leaving open for when we rely on glib 2.42 (still at 2.36 for now). The patch will need to be updated in any case.
Created attachment 287912 [details] [review] Updated patch, tests only Here's an updated patch. Since READWRITE is introspected properly as of 2.42, this only changes the tests.
Review of attachment 287912 [details] [review]: This looks good to commit, but only after the dependency has been bumped in gjs. Making a couple of lines in the tests shorter isn't a good enough reason though.
Pushed to master together with a version bump.