Commit d60a4e97 authored by Florian Müllner's avatar Florian Müllner
Browse files

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
parent 43883a69
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment