From 59ebacbe8eba4d29fa963128a045625e15e84b3a Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Mon, 8 Mar 2004 23:11:38 +0000 Subject: Fix again #136204 (GtkTextSearchFlags warning) --- gobject/gobjectmodule.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'gobject/gobjectmodule.c') diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index d91d81b..d780923 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -28,6 +28,9 @@ static PyObject *gerror_exc = NULL; +static void pyg_flags_add_constants(PyObject *module, GType flags_type, + const gchar *strip_prefix); + /* -------------- GDK threading hooks ---------------------------- */ /** @@ -1787,9 +1790,11 @@ pyg_enum_add_constants(PyObject *module, GType enum_type, GEnumClass *eclass; guint i; - /* a more useful warning */ if (!G_TYPE_IS_ENUM(enum_type)) { - g_warning("`%s' is not an enum type", g_type_name(enum_type)); + if (G_TYPE_IS_FLAGS(enum_type)) /* See bug #136204 */ + pyg_flags_add_constants(module, enum_type, strip_prefix); + else + g_warning("`%s' is not an enum type", g_type_name(enum_type)); return; } g_return_if_fail (strip_prefix != NULL); @@ -1824,9 +1829,11 @@ pyg_flags_add_constants(PyObject *module, GType flags_type, GFlagsClass *fclass; guint i; - /* a more useful warning */ if (!G_TYPE_IS_FLAGS(flags_type)) { - g_warning("`%s' is not an flags type", g_type_name(flags_type)); + if (G_TYPE_IS_ENUM(flags_type)) /* See bug #136204 */ + pyg_enum_add_constants(module, flags_type, strip_prefix); + else + g_warning("`%s' is not an flags type", g_type_name(flags_type)); return; } g_return_if_fail (strip_prefix != NULL); -- cgit