Commit 6737be89 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

* gladeui/glade-utils.[ch], gladeui/glade-widget.c, gladeui/glade-builtins.c,

	gladeui/glade-widget-adaptor.c, gladeui/glade-editor-property.c:
	Removed glade_util_class_implements_interface() in favor of g_type_is_a() (closes bug 455734).
parent 583ecb3c
2011-01-08 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-utils.[ch], gladeui/glade-widget.c, gladeui/glade-builtins.c,
gladeui/glade-widget-adaptor.c, gladeui/glade-editor-property.c:
Removed glade_util_class_implements_interface() in favor of g_type_is_a() (closes bug 455734).
2011-01-07 Emilio Pozuelo Monfort <pochu27@gmail.com>
* configure.ac: Bump the minimum GTK+ version to 2.99.0.
......@@ -12,7 +18,7 @@
* data/glade.desktop.in.in: Execute 'glade' since that's the name
of the binary now.
2011-01-06 Tristan Van Berkom <tristanvb@openismus.com>
2011-01-07 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-inspector.c: Updated to use GtkStyleContext to set the italic &
insensitive color for the < search widgets > entry.
......
......@@ -395,15 +395,9 @@ param_objects_validate (GParamSpec * pspec, GValue * value)
{
object = list->data;
if (G_TYPE_IS_INTERFACE (ospec->type) &&
glade_util_class_implements_interface
(G_OBJECT_TYPE (object), ospec->type) == FALSE)
if (!(G_OBJECT_TYPE (object) == ospec->type ||
g_type_is_a (G_OBJECT_TYPE (object), ospec->type)))
toremove = g_list_prepend (toremove, object);
else if (G_TYPE_IS_INTERFACE (ospec->type) == FALSE &&
g_type_is_a (G_OBJECT_TYPE (object), ospec->type) == FALSE)
toremove = g_list_prepend (toremove, object);
}
for (list = toremove; list; list = list->next)
......
......@@ -2480,13 +2480,11 @@ glade_eprop_object_populate_view_real (GtkTreeStore * model,
{
adaptor = glade_widget_get_adaptor (widget);
has_decendant = !parentless && glade_widget_has_decendant
(widget, object_type);
has_decendant =
!parentless && glade_widget_has_decendant (widget, object_type);
good_type = (glade_widget_adaptor_get_object_type (adaptor) == object_type ||
g_type_is_a (glade_widget_adaptor_get_object_type (adaptor), object_type) ||
glade_util_class_implements_interface (glade_widget_adaptor_get_object_type (adaptor),
object_type));
g_type_is_a (glade_widget_adaptor_get_object_type (adaptor), object_type));
if (parentless)
good_type = good_type && !GWA_IS_TOPLEVEL (adaptor);
......
......@@ -1179,33 +1179,6 @@ glade_util_copy_file (const gchar * src_path, const gchar * dest_path)
return success;
}
/**
* glade_util_class_implements_interface:
* @class_type: A #GType
* @iface_type: A #GType
*
* Returns: whether @class_type implements the @iface_type interface
*/
gboolean
glade_util_class_implements_interface (GType class_type, GType iface_type)
{
GType *ifaces;
guint n_ifaces, i;
gboolean implemented = FALSE;
if ((ifaces = g_type_interfaces (class_type, &n_ifaces)) != NULL)
{
for (i = 0; i < n_ifaces; i++)
if (ifaces[i] == iface_type)
{
implemented = TRUE;
break;
}
g_free (ifaces);
}
return implemented;
}
static GModule *
try_load_library (const gchar * library_path, const gchar * library_name)
{
......
......@@ -98,10 +98,6 @@ gchar *glade_util_canonical_path (const gchar *path);
gboolean glade_util_copy_file (const gchar *src_path,
const gchar *dest_path);
gboolean glade_util_class_implements_interface (GType class_type,
GType iface_type);
GModule *glade_util_load_library (const gchar *library_name);
......
......@@ -337,7 +337,7 @@ gwa_list_signals (GladeWidgetAdaptor * adaptor, GType real_type)
/* Add class interfaces signals */
for (i = p = g_type_interfaces (type, NULL); *i; i++)
if (!glade_util_class_implements_interface (parent, *i))
if (!g_type_is_a (parent, *i))
gwa_add_signals (adaptor, &signals, *i);
g_free (p);
......
......@@ -3680,12 +3680,8 @@ glade_widget_has_decendant (GladeWidget * widget, GType type)
GList *children, *l;
gboolean found = FALSE;
if (G_TYPE_IS_INTERFACE (type) &&
glade_util_class_implements_interface
(glade_widget_adaptor_get_object_type (widget->priv->adaptor), type))
return TRUE;
else if (G_TYPE_IS_INTERFACE (type) == FALSE &&
g_type_is_a (glade_widget_adaptor_get_object_type (widget->priv->adaptor), type))
if (glade_widget_adaptor_get_object_type (widget->priv->adaptor) == type ||
g_type_is_a (glade_widget_adaptor_get_object_type (widget->priv->adaptor), type))
return TRUE;
if ((children = glade_widget_adaptor_get_children
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment