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 634349 - ParamSpec get_default_value() for override and gtype
ParamSpec get_default_value() for override and gtype
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Glib
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2010-11-08 19:02 UTC by Kevin Ryde
Modified: 2010-11-21 20:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch and test cases (7.72 KB, patch)
2010-11-08 19:02 UTC, Kevin Ryde
none Details | Review
patch and test cases (7.55 KB, patch)
2010-11-12 20:09 UTC, Kevin Ryde
none Details | Review
patch and test cases (8.24 KB, patch)
2010-11-13 23:07 UTC, Kevin Ryde
committed Details | Review

Description Kevin Ryde 2010-11-08 19:02:55 UTC
Created attachment 174087 [details] [review]
patch and test cases

This is a get_default_value() method for the new Glib::Param::Override and Glib::Param::GType, using g_param_value_set_default().

It's done slightly with an eye to replacing the specific get_default_value() methods of the various param types, per other ticket, but to start with it gets override and gtype going.
Comment 1 Kevin Ryde 2010-11-12 20:09:57 UTC
Created attachment 174357 [details] [review]
patch and test cases

I see I should conditionalize the g_param_spec_get_redirect_target() bit for glib pre-2.4, and I seem to have accumulated too many unapplied changes to t/e.t, so this one perhaps applies clean against the head :-)
Comment 2 Torsten Schoenfeld 2010-11-13 00:05:21 UTC
Patch looks good to me.  I'm slightly uneasy about the fixed-size stack allocation of the g_unichar_to_utf8 target but that seems to be common enough.  Also, instead of newSVpv + SvUTF8_on, you could use newSVGChar.

More importantly, though: what prevents us from removing the specialized get_default_value() methods now?
Comment 3 Kevin Ryde 2010-11-13 21:22:15 UTC
I looked for the glib equiv of MB_LEN_MAX, I mean everything else in the C library has been duplicated, but apparently not that!

The specific get_default_value()s would only want the test cases of my other ticket re-diffed, just to make sure the new generic comes out right.
Comment 4 Kevin Ryde 2010-11-13 23:07:28 UTC
Created attachment 174409 [details] [review]
patch and test cases

I don't think newSVGChar suits as g_unichar_to_utf8() isn't null terminated, and the default value itself can be nul "\0".  I copied from the typemap T_GUNICHAR outputer, so the goodness from there is carried over :-)

I added test cases to exercise "0" and "\0" though.
Comment 5 Torsten Schoenfeld 2010-11-21 20:12:42 UTC
I see.  Looks great, committed.  Thanks.