diff options
author | Juan Pablo Ugarte <juanpablougarte@gmail.com> | 2012-09-06 21:15:29 -0300 |
---|---|---|
committer | Juan Pablo Ugarte <juanpablougarte@gmail.com> | 2012-09-06 21:42:54 -0300 |
commit | 3d014fcf54b47a5184ee89d2329c03e575bca790 (patch) | |
tree | 3952da2395644111092b1909852d7ed55f40635e /gladeui/glade-object-stub.c | |
parent | b25ee612bca1e8026b423814c157a2bc458b76df (diff) | |
download | glade-3d014fcf54b47a5184ee89d2329c03e575bca790.tar.gz |
Do not abort if a project has a uninstantiable or abstract class object
instead load is as an object stub and let the user what to do.
Should be enough to close bug #646259
"SIGSEGV in glade_widget_adaptor_object_construct_object loading ui file"
Diffstat (limited to 'gladeui/glade-object-stub.c')
-rw-r--r-- | gladeui/glade-object-stub.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gladeui/glade-object-stub.c b/gladeui/glade-object-stub.c index e15ce322..03365b98 100644 --- a/gladeui/glade-object-stub.c +++ b/gladeui/glade-object-stub.c @@ -122,11 +122,17 @@ glade_object_stub_refresh_text (GladeObjectStub *stub) { GladeObjectStubPrivate *priv = stub->priv; gchar *markup; + GType type; if (priv->type == NULL) return; - markup = g_markup_printf_escaped ("<b>FIXME:</b> Unable to create object with type %s", priv->type); + type = g_type_from_name (priv->type); + if ((type != G_TYPE_INVALID && (!G_TYPE_IS_INSTANTIATABLE (type) || G_TYPE_IS_ABSTRACT (type)))) + markup = g_markup_printf_escaped ("<b>FIXME:</b> Unable to create uninstantiable object with type %s", priv->type); + else + markup = g_markup_printf_escaped ("<b>FIXME:</b> Unable to create object with type %s", priv->type); + gtk_label_set_markup (priv->label, markup); gtk_info_bar_set_message_type (GTK_INFO_BAR (stub), GTK_MESSAGE_WARNING); g_free (markup); |