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
This commit is contained in:
Florian Müllner 2012-08-23 14:16:19 +02:00
parent 43883a6945
commit d60a4e97d6

View File

@ -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);