Performance improvements in filter function
This commit is contained in:
parent
1101026d19
commit
5686bdb834
@ -197,18 +197,18 @@ static gboolean mainWindow_list_entry_visible(GtkTreeModel *model, GtkTreeIter *
|
||||
if (searchString[0] != 0) {
|
||||
regex = g_regex_new(searchString, G_REGEX_CASELESS, 0, NULL);
|
||||
|
||||
gtk_tree_model_get(model, iter, COL_TEXT, &temp, -1);
|
||||
gtk_tree_model_get(model, iter, COL_TITLE, &temp, -1);
|
||||
if (g_regex_match(regex, temp, 0, &match_info) && g_match_info_matches(match_info))
|
||||
search_matched = 1;
|
||||
g_free(temp);
|
||||
|
||||
gtk_tree_model_get(model, iter, COL_TEXT, &temp, -1);
|
||||
if (!search_matched && g_regex_match(regex, temp, 0, &match_info) && g_match_info_matches(match_info))
|
||||
search_matched = 1;
|
||||
g_free(temp);
|
||||
|
||||
gtk_tree_model_get(model, iter, COL_TAGS_TEXT, &temp, -1);
|
||||
if (g_regex_match(regex, temp, 0, &match_info) && g_match_info_matches(match_info))
|
||||
search_matched = 1;
|
||||
g_free(temp);
|
||||
|
||||
gtk_tree_model_get(model, iter, COL_TITLE, &temp, -1);
|
||||
if (g_regex_match(regex, temp, 0, &match_info) && g_match_info_matches(match_info))
|
||||
if (!search_matched && g_regex_match(regex, temp, 0, &match_info) && g_match_info_matches(match_info))
|
||||
search_matched = 1;
|
||||
g_free(temp);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user