[Xfce4-commits] <design:master> Don't use collate for category comparing.

Nick Schermer noreply at xfce.org
Sun Jun 5 19:46:02 CEST 2011


Updating branch refs/heads/master
         to 01d0956788e9f757362ce7e4b79c5904efa724f6 (commit)
       from 8934cabe65178cdde229d7103851ae828e047374 (commit)

commit 01d0956788e9f757362ce7e4b79c5904efa724f6
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Jun 5 18:27:51 2011 +0200

    Don't use collate for category comparing.

 .../merge-with-xfrun/demo-code/c/appfinder-model.c |   17 +++--------------
 1 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/xfce4-appfinder/merge-with-xfrun/demo-code/c/appfinder-model.c b/xfce4-appfinder/merge-with-xfrun/demo-code/c/appfinder-model.c
index 1365dfb..615735c 100644
--- a/xfce4-appfinder/merge-with-xfrun/demo-code/c/appfinder-model.c
+++ b/xfce4-appfinder/merge-with-xfrun/demo-code/c/appfinder-model.c
@@ -668,7 +668,6 @@ xfce_appfinder_model_collect_items (XfceAppfinderModel *model,
   GarconMenuDirectory *directory;
   ModelItem           *item;
   gboolean             has_items = FALSE;
-  gchar               *category_collated = NULL;
   const gchar         *desktop_id;
 
   g_return_val_if_fail (GARCON_IS_MENU (menu), FALSE);
@@ -680,11 +679,7 @@ xfce_appfinder_model_collect_items (XfceAppfinderModel *model,
         return FALSE;
 
       if (category == NULL)
-        {
-          category = garcon_menu_directory_get_name (directory);
-          category_collated = g_utf8_collate_key (category, -1);
-          category = category_collated;
-        }
+        category = garcon_menu_directory_get_name (directory);
     }
 
   /* collect all the elements in this menu and its sub menus */
@@ -728,8 +723,6 @@ xfce_appfinder_model_collect_items (XfceAppfinderModel *model,
     }
   g_list_free (elements);
 
-  g_free (category_collated);
-
   if (directory != NULL
       && has_items)
     model->collect_categories = g_slist_prepend (model->collect_categories, directory);
@@ -941,15 +934,11 @@ xfce_appfinder_model_filter_category (XfceAppfinderModel *model,
 {
   g_return_if_fail (XFCE_IS_APPFINDER_MODEL (model));
 
-  if (model->filter_category == category)
+  if (g_strcmp0 (model->filter_category, category) == 0)
     return;
 
   g_free (model->filter_category);
-
-  if (category != NULL)
-    model->filter_category = g_utf8_collate_key (category, -1);
-  else
-    model->filter_category = NULL;
+  model->filter_category = g_strdup (category);
 
   xfce_appfinder_model_filter (model);
 }



More information about the Xfce4-commits mailing list