Check sokoke_has_default instead of placeholder text

It is set if there's a placeholder (and GTK+ 3 returns NULL text).
This commit is contained in:
Christian Dywan 2012-08-08 23:47:51 +02:00
parent f145efaabc
commit 60f93f157a
3 changed files with 6 additions and 6 deletions

View file

@ -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)

View file

@ -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);

View file

@ -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);