Performance improvements in filter function

newfile
Markus Koch 2017-02-03 22:56:31 +01:00
parent 1101026d19
commit 5686bdb834
1 changed files with 7 additions and 7 deletions

View File

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