[gnome-shell] shell-app: Don't match on comments



commit d60a4e97d6bdb6b1a8365f5a2ae37bafd5b243e8
Author: Florian MÃllner <fmuellner gnome org>
Date:   Thu Aug 23 14:16:19 2012 +0200

    shell-app: Don't match on comments
    
    Comments are meant to be displayed, not to be searched - we should
    rather advertise the use of Keywords, which yields much better results.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682529

 src/shell-app.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index 7046154..5b2a21e 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -74,7 +74,6 @@ struct _ShellApp
 
   char *casefolded_name;
   char *name_collation_key;
-  char *casefolded_description;
   char *casefolded_exec;
   char **casefolded_keywords;
 };
@@ -1310,7 +1309,6 @@ shell_app_init_search_data (ShellApp *app)
 {
   const char *name;
   const char *exec;
-  const char *comment;
   const char * const *keywords;
   char *normalized_exec;
   GDesktopAppInfo *appinfo;
@@ -1319,9 +1317,6 @@ shell_app_init_search_data (ShellApp *app)
   name = g_app_info_get_name (G_APP_INFO (appinfo));
   app->casefolded_name = shell_util_normalize_and_casefold (name);
 
-  comment = g_app_info_get_description (G_APP_INFO (appinfo));
-  app->casefolded_description = shell_util_normalize_and_casefold (comment);
-
   exec = g_app_info_get_executable (G_APP_INFO (appinfo));
   normalized_exec = shell_util_normalize_and_casefold (exec);
   app->casefolded_exec = trim_exec_line (normalized_exec);
@@ -1403,16 +1398,6 @@ _shell_app_match_search_terms (ShellApp  *app,
             }
         }
 
-      if (app->casefolded_description && current_match < MATCH_PREFIX)
-        {
-          /* Only do substring matches, as prefix matches are not meaningful
-           * enough for descriptions
-           */
-          p = strstr (app->casefolded_description, term);
-          if (p != NULL)
-            current_match = MATCH_SUBSTRING;
-        }
-
       if (app->casefolded_keywords)
         {
           int i = 0;
@@ -1511,7 +1496,6 @@ shell_app_finalize (GObject *object)
 
   g_free (app->casefolded_name);
   g_free (app->name_collation_key);
-  g_free (app->casefolded_description);
   g_free (app->casefolded_exec);
   g_strfreev (app->casefolded_keywords);
 



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