[Xfce4-commits] [xfce/xfce4-appfinder] 01/01: Use casefolded string when searching for apps not commands (Bug #15893)

noreply at xfce.org noreply at xfce.org
Sun Sep 1 18:57:58 CEST 2019


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-appfinder.

commit f55f2f9a21c2ab44512cb8a515c10230775ad301
Author: Andre Miranda <andreldm at xfce.org>
Date:   Sun Sep 1 13:51:41 2019 -0300

    Use casefolded string when searching for apps not commands (Bug #15893)
---
 src/appfinder-model.c  |  8 ++++----
 src/appfinder-model.h  |  3 ++-
 src/appfinder-window.c | 12 ++++--------
 3 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/appfinder-model.c b/src/appfinder-model.c
index 31c537d..7a2bb7b 100644
--- a/src/appfinder-model.c
+++ b/src/appfinder-model.c
@@ -1982,7 +1982,8 @@ gboolean
 xfce_appfinder_model_get_visible (XfceAppfinderModel        *model,
                                   const GtkTreeIter         *iter,
                                   const GarconMenuDirectory *category,
-                                  const gchar               *string)
+                                  const gchar               *string,
+                                  const gchar               *string_casefold)
 {
   ModelItem *item;
   GarconMenuDirectory *bookmarks;
@@ -2019,9 +2020,8 @@ xfce_appfinder_model_get_visible (XfceAppfinderModel        *model,
             }
         }
 
-      if (string != NULL
-          && item->key != NULL)
-        return xfce_appfinder_model_fuzzy_match (item->key, string);
+      if (string_casefold != NULL && item->key != NULL)
+        return xfce_appfinder_model_fuzzy_match (item->key, string_casefold);
     }
   else /* command item */
     {
diff --git a/src/appfinder-model.h b/src/appfinder-model.h
index 9a96f2e..0db7233 100644
--- a/src/appfinder-model.h
+++ b/src/appfinder-model.h
@@ -74,7 +74,8 @@ GSList              *xfce_appfinder_model_get_categories         (XfceAppfinderM
 gboolean             xfce_appfinder_model_get_visible            (XfceAppfinderModel        *model,
                                                                   const GtkTreeIter         *iter,
                                                                   const GarconMenuDirectory *category,
-                                                                  const gchar               *string);
+                                                                  const gchar               *string,
+                                                                  const gchar               *string_casefold);
 
 gboolean             xfce_appfinder_model_get_visible_command    (XfceAppfinderModel        *model,
                                                                   const GtkTreeIter         *iter,
diff --git a/src/appfinder-window.c b/src/appfinder-window.c
index 1c41975..6ef6eba 100644
--- a/src/appfinder-window.c
+++ b/src/appfinder-window.c
@@ -1671,17 +1671,13 @@ xfce_appfinder_window_item_visible (GtkTreeModel *model,
                                     gpointer      data)
 {
   XfceAppfinderWindow *window = XFCE_APPFINDER_WINDOW (data);
-  /* don't use the casefolded key generated by gtk */
   const gchar *filter_string = gtk_entry_get_text (GTK_ENTRY (window->entry));
-  gchar *filter_string_down = g_ascii_strdown (filter_string, -1);
 
-  gboolean res = xfce_appfinder_model_get_visible (XFCE_APPFINDER_MODEL (model), iter,
+  return xfce_appfinder_model_get_visible (XFCE_APPFINDER_MODEL (model),
+                                           iter,
                                            window->filter_category,
-                                           filter_string_down);
-
-  g_free(filter_string_down);
-
-  return res;
+                                           filter_string,
+                                           window->filter_text);
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list