After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727370 - Add READWRITE, STATIC_STRINGS, etc. to GObject.ParamFlags
Add READWRITE, STATIC_STRINGS, etc. to GObject.ParamFlags
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Philip Chimento
gjs-maint
Depends on: 687615
Blocks:
 
 
Reported: 2014-03-31 02:39 UTC by Philip Chimento
Modified: 2015-10-27 22:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (currently broken!) (2.64 KB, patch)
2014-03-31 02:40 UTC, Philip Chimento
needs-work Details | Review
Updated patch, tests only (1.85 KB, patch)
2014-10-07 05:59 UTC, Philip Chimento
committed Details | Review

Description Philip Chimento 2014-03-31 02:39:28 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.
Comment 1 Philip Chimento 2014-03-31 02:40:38 UTC
Created attachment 273312 [details] [review]
Patch (currently broken!)

This patch should work when one of the abovementioned bugs is solved.
Comment 2 Giovanni Campagna 2014-05-06 22:12:48 UTC
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.
Comment 3 Giovanni Campagna 2014-05-06 22:13:50 UTC
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.
Comment 4 Philip Chimento 2014-05-06 23:58:34 UTC
Basically near the top of every GJS file I write is this line:

GObject.ParamFlags.READWRITE = GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE;

;-)
Comment 5 Philip Chimento 2014-05-07 00:01:39 UTC
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 6 Bastien Nocera 2014-09-29 17:44:23 UTC
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.
Comment 7 Philip Chimento 2014-10-07 05:59:14 UTC
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.
Comment 8 Bastien Nocera 2014-10-13 13:41:12 UTC
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.
Comment 9 Cosimo Cecchi 2015-10-27 22:43:17 UTC
Pushed to master together with a version bump.