From 60f93f157a6c73ae1733627852b425fa968352ce Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Wed, 8 Aug 2012 23:47:51 +0200 Subject: [PATCH] Check sokoke_has_default instead of placeholder text It is set if there's a placeholder (and GTK+ 3 returns NULL text). --- extensions/cookie-manager/cookie-manager-page.c | 8 ++++---- panels/midori-bookmarks.c | 2 +- panels/midori-history.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/cookie-manager/cookie-manager-page.c b/extensions/cookie-manager/cookie-manager-page.c index 2fe35c4d..186e310e 100644 --- a/extensions/cookie-manager/cookie-manager-page.c +++ b/extensions/cookie-manager/cookie-manager-page.c @@ -809,7 +809,7 @@ static void cm_filter_entry_changed_cb(GtkEditable *editable, CookieManagerPage if (priv->ignore_changed_filter) return; - if (gtk_entry_get_placeholder_text(GTK_ENTRY(editable)) != NULL) + if (!g_object_get_data (G_OBJECT (editable), "sokoke_has_default")) text = gtk_entry_get_text(GTK_ENTRY(editable)); else text = NULL; @@ -817,10 +817,10 @@ static void cm_filter_entry_changed_cb(GtkEditable *editable, CookieManagerPage cookie_manager_update_filter(priv->parent, text); - if (*text != '\0') - gtk_tree_view_expand_all(GTK_TREE_VIEW(priv->treeview)); - else + if (text && *text) gtk_tree_view_collapse_all(GTK_TREE_VIEW(priv->treeview)); + else + gtk_tree_view_expand_all(GTK_TREE_VIEW(priv->treeview)); } static void cm_tree_selection_changed_cb(GtkTreeSelection *selection, CookieManagerPage *cmp) diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c index 0f6b5d71..39b4950a 100644 --- a/panels/midori-bookmarks.c +++ b/panels/midori-bookmarks.c @@ -1002,7 +1002,7 @@ midori_bookmarks_filter_entry_changed_cb (GtkEntry* entry, if (bookmarks->filter_timeout) g_source_remove (bookmarks->filter_timeout); - if (gtk_entry_get_placeholder_text (entry) != NULL) + if (!g_object_get_data (G_OBJECT (entry), "sokoke_has_default")) katze_assign (bookmarks->filter, g_strdup (gtk_entry_get_text (entry))); else katze_assign (bookmarks->filter, NULL); diff --git a/panels/midori-history.c b/panels/midori-history.c index b8ac99ee..c1bb1816 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -968,7 +968,7 @@ midori_history_filter_entry_changed_cb (GtkEntry* entry, history->filter_timeout = g_timeout_add (COMPLETION_DELAY, midori_history_filter_timeout_cb, history); - if (gtk_entry_get_placeholder_text (entry) != NULL) + if (!g_object_get_data (G_OBJECT (entry), "sokoke_has_default")) katze_assign (history->filter, g_strdup (gtk_entry_get_text (entry))); else katze_assign (history->filter, NULL); -- 2.39.5