[gtk+] GtkSearchBar: Handle lack of an entry
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkSearchBar: Handle lack of an entry
- Date: Mon, 9 Jun 2014 17:46:37 +0000 (UTC)
commit 115faae37187d13a9e022aad47f692ee87a4de59
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jun 9 09:36:47 2014 -0400
GtkSearchBar: Handle lack of an entry
We were not dealing with the possibility of priv->entry being
NULL in all places.
gtk/gtksearchbar.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c
index 8104abe..1181d48 100644
--- a/gtk/gtksearchbar.c
+++ b/gtk/gtksearchbar.c
@@ -254,10 +254,13 @@ reveal_child_changed_cb (GObject *object,
priv->reveal_child = reveal_child;
- if (reveal_child)
- _gtk_entry_grab_focus (GTK_ENTRY (priv->entry), FALSE);
- else
- gtk_entry_set_text (GTK_ENTRY (priv->entry), "");
+ if (priv->entry)
+ {
+ if (reveal_child)
+ _gtk_entry_grab_focus (GTK_ENTRY (priv->entry), FALSE);
+ else
+ gtk_entry_set_text (GTK_ENTRY (priv->entry), "");
+ }
g_object_notify (G_OBJECT (bar), "search-mode-enabled");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]