]> spindle.queued.net Git - midori/commitdiff
Check sokoke_has_default instead of placeholder text
authorChristian Dywan <christian@twotoasts.de>
Wed, 8 Aug 2012 21:47:51 +0000 (23:47 +0200)
committerChristian Dywan <christian@twotoasts.de>
Wed, 8 Aug 2012 23:02:56 +0000 (01:02 +0200)
It is set if there's a placeholder (and GTK+ 3 returns NULL text).

extensions/cookie-manager/cookie-manager-page.c
panels/midori-bookmarks.c
panels/midori-history.c

index 2fe35c4d78a9f2d87f6f563909c7da1b68c1a615..186e310e5d553ed1e0347bdd865d99ff93c6b3f8 100644 (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)
index 0f6b5d716fc0b605d99af8e75d3776b639393d89..39b4950acb57abf7e478fdbac52cdcaf825201be 100644 (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);
index b8ac99ee9c90d4e125ef04e60c5d0d1c7da3827e..c1bb1816bb8fec51e08cebeeb6156df8607510ca 100644 (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);