GNOME Bugzilla – Bug 567789
Make EvDocumentInfo and friends GTypes
Last modified: 2009-01-18 21:33:58 UTC
Need it to be a GType so it can be used by language bindings like python.
Created attachment 126448 [details] [review] first try
+ static GType type = 0; + + if (G_UNLIKELY (type == 0)) { Should use the standard pattern for get_type functions, which is using g_once_*. + if (info->title) + copy->title = g_strdup (info->title); g_strdup is NULL-safe. Why are you hardcoding the get_type functions for the enum/flags types, instead of using glib-mkenums for this?
Created attachment 126529 [details] [review] use glib-mkenums
Would you prefer to use template files instead of putting the templates in the Makefile?
(In reply to comment #4) > Would you prefer to use template files instead of putting the templates in the > Makefile? > yes please, like we already do in libview.
Created attachment 126703 [details] [review] use glib-mkenums and templates
Created attachment 126708 [details] [review] revised patch after code review in irc
Applied to svn trunk (r3356). Thanks.
It's still using the + static GType type = 0; + if (type == 0) get_type for the boxed type, not g_once_*().
yes, it's what we are using for all the interfaces and what gtk+ does for boxed types too. What's exactly wrong?
Oh, I see. Well, it's not threadsafe. Also for consistency's sake, I think evince should use the g_once_* thing (like G_DEFINE_TYPE does). I'll file a separate bug then.