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 683167 - g_time_zone_new not introspectable
g_time_zone_new not introspectable
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
: 676922 (view as bug list)
Depends on:
Blocks: 682167
 
 
Reported: 2012-09-01 19:06 UTC by Paolo Borelli
Modified: 2015-02-07 17:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Box GTimeZone to make it introspectable (2.77 KB, patch)
2012-09-03 19:44 UTC, Martin Pitt
none Details | Review
Box GTimeZone to make it introspectable (2.93 KB, patch)
2012-09-06 04:41 UTC, Martin Pitt
committed Details | Review

Description Paolo Borelli 2012-09-01 19:06:31 UTC
I would like to use GTimeZone in clocks, but it is not available through pygobject.


For a start, it is not a boxed type, so I added the following:

diff --git a/gobject/gboxed.c b/gobject/gboxed.c
index 7936d45..b5c6029 100644
--- a/gobject/gboxed.c
+++ b/gobject/gboxed.c
@@ -144,6 +144,7 @@ G_DEFINE_BOXED_TYPE (GVariantBuilder, g_variant_builder, g_v
 G_DEFINE_BOXED_TYPE (GError, g_error, g_error_copy, g_error_free)
 
 G_DEFINE_BOXED_TYPE (GDateTime, g_date_time, g_date_time_ref, g_date_time_unref
+G_DEFINE_BOXED_TYPE (GTimeZone, g_time_zone, g_time_zone_ref, g_time_zone_unref
 G_DEFINE_BOXED_TYPE (GKeyFile, g_key_file, g_key_file_ref, g_key_file_unref)
 
 G_DEFINE_BOXED_TYPE (GMainLoop, g_main_loop, g_main_loop_ref, g_main_loop_unref
(END)



However that does not seem to be enough and the introspection magic of glib bits is not very clear to me...
Comment 1 Martin Pitt 2012-09-03 10:48:24 UTC
Confirming. Even after building glib with this patch and updating glib annotations in g-i, the GLib.TimeZone struct is still shown as disguised="1" and the constructor/methods are not introspectable. I had assumed that the g-ir-scanner (which links against the patched glib) would see the boxing..
Comment 2 Martin Pitt 2012-09-03 19:44:50 UTC
Created attachment 223363 [details] [review]
Box GTimeZone to make it introspectable

I tested this patch, and it works. Thanks to Johan Dahlin for pointing out my previous error!
Comment 3 Paolo Borelli 2012-09-03 19:45:48 UTC
Review of attachment 223363 [details] [review]:

::: gobject/glib-types.h
@@ -172,0 +172,5 @@
+ * G_TYPE_TIME_ZONE:
+ *
+ * The #GType for a boxed type holding a #GTimeZone.
... 2 more ...

this needs to be 2.34, no?
Comment 4 Paolo Borelli 2012-09-03 19:53:04 UTC
Review of attachment 223363 [details] [review]:

::: docs/reference/gobject/gobject-sections.txt
@@ -390,2 +390,3 @@
 g_error_get_type
 g_date_time_get_type
+g_time_zone_get_type

you also need to add G_TYPE_TIME_ZONE above near G_TYPE_DATE_TIME
Comment 5 Martin Pitt 2012-09-03 20:51:13 UTC
(In reply to comment #3)
> Review of attachment 223363 [details] [review]:
> 
> ::: gobject/glib-types.h
> @@ -172,0 +172,5 @@
> + * G_TYPE_TIME_ZONE:
> + *
> + * The #GType for a boxed type holding a #GTimeZone.
> ... 2 more ...
> 
> this needs to be 2.34, no?

Hm, I'm not sure. The GTimeZone API itself exists since 2.26 according to glib/gtimezone.c, that's where I took the number from. Technically, _time_zone_get_type() has existed since then, but not as public API. So if 2.34 is more appropriate, I'm happy to change it to this.

> you also need to add G_TYPE_TIME_ZONE above near G_TYPE_DATE_TIME

Ah yes, thanks for spotting.
Comment 6 Matthias Clasen 2012-09-06 00:44:03 UTC

> > 
> > this needs to be 2.34, no?
> 
> Hm, I'm not sure. The GTimeZone API itself exists since 2.26 according to
> glib/gtimezone.c, that's where I took the number from. Technically,
> _time_zone_get_type() has existed since then, but not as public API. So if 2.34
> is more appropriate, I'm happy to change it to this.

I vote for 2.34
Comment 7 Martin Pitt 2012-09-06 04:41:53 UTC
Created attachment 223606 [details] [review]
Box GTimeZone to make it introspectable

This time with 10% more love!
Comment 8 Matthias Clasen 2012-09-06 11:31:20 UTC
Review of attachment 223606 [details] [review]:

ok
Comment 9 Martin Pitt 2012-09-06 11:40:41 UTC
Comment on attachment 223606 [details] [review]
Box GTimeZone to make it introspectable

Pushed. For everyone trying this, please note that you need to rebuild g-i against this glib installation for the girs to pick up this change.
Comment 10 Ignacio Casal Quinteiro (nacho) 2012-11-04 15:56:38 UTC
*** Bug 676922 has been marked as a duplicate of this bug. ***
Comment 11 André Klapper 2015-02-07 17:01:03 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]