summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan@upstairslabs.com>2014-10-26 23:06:52 +0900
committerTristan Van Berkom <tristan@upstairslabs.com>2014-10-26 23:06:52 +0900
commit8730f94991ec02a7afc3758ab52314485388b2e1 (patch)
tree47b22d2da22a827f14a814c06f528a793a1c362a
parent67e74fac359ec0bf47f076444d24787132a6be94 (diff)
downloadglade-8730f94991ec02a7afc3758ab52314485388b2e1.tar.gz
glade-gtk-widget.c: Minor fix for 'add_parent' actionsearchbar
Previous implementation assumes that the parent widget can be retrieved with gtk_widget_get_parent(), use glade_widget_get_parent() instead and trust the project datamodel instead, as the logical widget hierarchy may not be exactly the truth, as is the case for a searchbar child.
-rw-r--r--plugins/gtk+/glade-gtk-widget.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/plugins/gtk+/glade-gtk-widget.c b/plugins/gtk+/glade-gtk-widget.c
index 14f37186..019f1091 100644
--- a/plugins/gtk+/glade-gtk-widget.c
+++ b/plugins/gtk+/glade-gtk-widget.c
@@ -808,14 +808,9 @@ glade_gtk_widget_action_activate (GladeWidgetAdaptor * adaptor,
{
GladeWidget *gwidget = glade_widget_get_from_gobject (object), *gparent;
GList this_widget = { 0, }, that_widget = { 0,};
- GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (object));
GladeProject *project;
- if (parent)
- gparent = glade_widget_get_from_gobject (parent);
- else
- gparent = NULL;
-
+ gparent = glade_widget_get_parent (gwidget);
project = glade_widget_get_project (gwidget);
if (strcmp (action_path, "preview") == 0)
@@ -971,7 +966,7 @@ glade_gtk_widget_action_activate (GladeWidgetAdaptor * adaptor,
}
else if (strcmp (action_path, "clear_properties") == 0)
{
- glade_editor_reset_dialog_run (gtk_widget_get_toplevel (parent), gwidget);
+ glade_editor_reset_dialog_run (gtk_widget_get_toplevel (GTK_WIDGET (object)), gwidget);
}
else if (strcmp (action_path, "read_documentation") == 0)
{