[gtk+] builder-tool: Try harder to find types
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] builder-tool: Try harder to find types
- Date: Thu, 18 Jan 2018 22:53:57 +0000 (UTC)
commit 6c805ecb0f1b67ff2dbe6c56de03eae7dff81403
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jan 18 17:45:12 2018 -0500
builder-tool: Try harder to find types
If g_type_from_name fails, try gtk_builder_get_type_from_name
before giving up. This fixes cases like GtkPrinterOptionWidget.
gtk/gtk-builder-tool.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtk-builder-tool.c b/gtk/gtk-builder-tool.c
index 8ed47ed..ebd965e 100644
--- a/gtk/gtk-builder-tool.c
+++ b/gtk/gtk-builder-tool.c
@@ -80,7 +80,13 @@ get_property_pspec (MyParserData *data,
type = g_type_from_name (class_name);
if (type == G_TYPE_INVALID)
- return NULL;
+ {
+ GtkBuilder *builder = gtk_builder_new ();
+ type = gtk_builder_get_type_from_name (builder, class_name);
+ g_object_unref (builder);
+ if (type == G_TYPE_INVALID)
+ return NULL;
+ }
class = g_type_class_ref (type);
canonical_name = g_strdup (property_name);
@@ -197,7 +203,6 @@ needs_explicit_setting (MyParserData *data,
{ "GtkGrid", "top-attach", 1 },
{ "GtkWidget", "hexpand", 0 },
{ "GtkWidget", "vexpand", 0 },
- { "GtkVBox", "expand", 1 },
{ NULL, NULL, 0 }
};
gchar *canonical_name;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]