[gnome-software] Do not filter the installed list with the search entry



commit 7a7ca6c93c37ece43f4bcdf0d8be83b295ae7668
Author: Richard Hughes <richard hughsie com>
Date:   Thu Aug 29 12:45:52 2013 +0100

    Do not filter the installed list with the search entry

 src/gs-shell-installed.c |   83 ----------------------------------------------
 1 files changed, 0 insertions(+), 83 deletions(-)
---
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 4049dda..e32001d 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -299,10 +299,6 @@ gs_shell_installed_get_installed_cb (GObject *source_object,
                                               priv->sizegroup_name);
                gtk_widget_show (widget);
        }
-
-       /* focus back to the text extry */
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_search"));
-       gtk_widget_grab_focus (widget);
 out: ;
 }
 
@@ -376,18 +372,6 @@ gs_shell_installed_refresh (GsShellInstalled *shell_installed)
 }
 
 /**
- * gs_shell_installed_filter_text_changed_cb:
- **/
-static gboolean
-gs_shell_installed_filter_text_changed_cb (GtkEntry *entry,
-                                          GsShellInstalled *shell_installed)
-{
-       GsShellInstalledPrivate *priv = shell_installed->priv;
-       gtk_list_box_invalidate_filter (priv->list_box_installed);
-       return FALSE;
-}
-
-/**
  * gs_shell_installed_sort_func:
  **/
 static gint
@@ -412,64 +396,6 @@ gs_shell_installed_sort_func (GtkListBoxRow *a,
 }
 
 /**
- * gs_shell_installed_utf8_filter_helper:
- **/
-static gboolean
-gs_shell_installed_utf8_filter_helper (const gchar *haystack,
-                                      const gchar *needle_utf8)
-{
-       gboolean ret;
-       gchar *haystack_utf8;
-       haystack_utf8 = g_utf8_casefold (haystack, -1);
-       ret = strstr (haystack_utf8, needle_utf8) != NULL;
-       g_free (haystack_utf8);
-       return ret;
-}
-
-/**
- * gs_shell_installed_filter_func:
- **/
-static gboolean
-gs_shell_installed_filter_func (GtkListBoxRow *row, void *user_data)
-{
-       const gchar *tmp;
-       gboolean ret = TRUE;
-       gchar *needle_utf8 = NULL;
-       GsApp *app;
-       GsAppWidget *app_widget = GS_APP_WIDGET (gtk_bin_get_child (GTK_BIN (row)));
-       GsShellInstalled *shell_installed = GS_SHELL_INSTALLED (user_data);
-       GsShellInstalledPrivate *priv = shell_installed->priv;
-       GtkWidget *widget;
-
-       app = gs_app_widget_get_app (app_widget);
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_search"));
-       tmp = gtk_entry_get_text (GTK_ENTRY (widget));
-       if (tmp[0] == '\0')
-               goto out;
-
-       needle_utf8 = g_utf8_casefold (tmp, -1);
-       ret = gs_shell_installed_utf8_filter_helper (gs_app_get_name (app),
-                                         needle_utf8);
-       if (ret)
-               goto out;
-       ret = gs_shell_installed_utf8_filter_helper (gs_app_get_summary (app),
-                                         needle_utf8);
-       if (ret)
-               goto out;
-       ret = gs_shell_installed_utf8_filter_helper (gs_app_get_version (app),
-                                         needle_utf8);
-       if (ret)
-               goto out;
-       ret = gs_shell_installed_utf8_filter_helper (gs_app_get_id (app),
-                                         needle_utf8);
-       if (ret)
-               goto out;
-out:
-       g_free (needle_utf8);
-       return ret;
-}
-
-/**
  * gs_shell_installed_list_header_func
  **/
 static void
@@ -540,11 +466,6 @@ gs_shell_installed_setup (GsShellInstalled *shell_installed,
        priv->builder = g_object_ref (builder);
        priv->cancellable = g_object_ref (cancellable);
 
-       /* refilter on search box changing */
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_search"));
-       g_signal_connect (GTK_EDITABLE (widget), "changed",
-                         G_CALLBACK (gs_shell_installed_filter_text_changed_cb), shell_installed);
-
        /* setup installed */
        priv->list_box_installed = GTK_LIST_BOX (gtk_list_box_new ());
        g_signal_connect (priv->list_box_installed, "row-activated",
@@ -553,10 +474,6 @@ gs_shell_installed_setup (GsShellInstalled *shell_installed,
                                      gs_shell_installed_list_header_func,
                                      shell_installed,
                                      NULL);
-       gtk_list_box_set_filter_func (priv->list_box_installed,
-                                     gs_shell_installed_filter_func,
-                                     shell_installed,
-                                     NULL);
        gtk_list_box_set_sort_func (priv->list_box_installed,
                                    gs_shell_installed_sort_func,
                                    shell_installed,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]