[glade: 4/5] glade-gtk-searchbar.c: Avoid critical warnings when loading searchbars
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade: 4/5] glade-gtk-searchbar.c: Avoid critical warnings when loading searchbars
- Date: Sun, 26 Oct 2014 14:12:06 +0000 (UTC)
commit 67e74fac359ec0bf47f076444d24787132a6be94
Author: Tristan Van Berkom <tristan upstairslabs com>
Date: Sun Oct 26 22:56:07 2014 +0900
glade-gtk-searchbar.c: Avoid critical warnings when loading searchbars
Changed glade_gtk_search_bar_add_child() to not make the assumption
that a current "child" widget exists, which it doesnt at project load
time (until one is actually loaded).
plugins/gtk+/glade-gtk-searchbar.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-searchbar.c b/plugins/gtk+/glade-gtk-searchbar.c
index 30c25b5..1a54090 100644
--- a/plugins/gtk+/glade-gtk-searchbar.c
+++ b/plugins/gtk+/glade-gtk-searchbar.c
@@ -85,8 +85,11 @@ glade_gtk_search_bar_add_child (GladeWidgetAdaptor *adaptor,
GObject *child)
{
GObject *current;
+
current = g_object_get_data (G_OBJECT (object), "child");
- gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (GTK_WIDGET (current))), GTK_WIDGET (current));
+ if (current)
+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (GTK_WIDGET (current))), GTK_WIDGET
(current));
+
gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
g_object_set_data (G_OBJECT (object), "child", child);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]