https://github.com/BestImageViewer/geeqie/pull/779
<variablelist>\r
<varlistentry>\r
<term>\r
<variablelist>\r
<varlistentry>\r
<term>\r
- <guilabel>File name</guilabel>\r
+ <guilabel>File</guilabel>\r
- The search will match if the entered text appears within the file name, or if the text exactly matches the file name, depending on the method selected from the drop down menu. The text comparison can be made to be case sensitive by enabling the Match case checkbox.\r
+ If "name is" is selected, the search will match if the text exactly matches the file name. If "name contains" or "path contains" is selected, the search will match if the entered text appears within the file name or path.<para/>The text comparison can be made to be case sensitive by enabling the Match case checkbox.\r
- If "contains" is selected,\r
+ If "contains" or "path contains" is selected,\r
<link linkend="GuideReferencePCRE">Perl Compatible Regular Expressions</link>\r
are used.\r
</listitem>\r
<link linkend="GuideReferencePCRE">Perl Compatible Regular Expressions</link>\r
are used.\r
</listitem>\r
SEARCH_MATCH_NONE,
SEARCH_MATCH_EQUAL,
SEARCH_MATCH_CONTAINS,
SEARCH_MATCH_NONE,
SEARCH_MATCH_EQUAL,
SEARCH_MATCH_CONTAINS,
+ SEARCH_MATCH_NAME_EQUAL,
+ SEARCH_MATCH_NAME_CONTAINS,
+ SEARCH_MATCH_PATH_CONTAINS,
SEARCH_MATCH_UNDER,
SEARCH_MATCH_OVER,
SEARCH_MATCH_BETWEEN,
SEARCH_MATCH_UNDER,
SEARCH_MATCH_OVER,
SEARCH_MATCH_BETWEEN,
};
static const MatchList text_search_menu_name[] = {
};
static const MatchList text_search_menu_name[] = {
- { N_("contains"), SEARCH_MATCH_CONTAINS },
- { N_("is"), SEARCH_MATCH_EQUAL }
+ { N_("name contains"), SEARCH_MATCH_NAME_CONTAINS },
+ { N_("name is"), SEARCH_MATCH_NAME_EQUAL },
+ { N_("path contains"), SEARCH_MATCH_PATH_CONTAINS }
};
static const MatchList text_search_menu_size[] = {
};
static const MatchList text_search_menu_size[] = {
tested = TRUE;
match = FALSE;
tested = TRUE;
match = FALSE;
- if (sd->match_name == SEARCH_MATCH_EQUAL)
+ if (sd->match_name == SEARCH_MATCH_NAME_EQUAL)
{
if (sd->search_name_match_case)
{
{
if (sd->search_name_match_case)
{
match = (g_ascii_strcasecmp(fd->name, sd->search_name) == 0);
}
}
match = (g_ascii_strcasecmp(fd->name, sd->search_name) == 0);
}
}
- else if (sd->match_name == SEARCH_MATCH_CONTAINS)
+ else if (sd->match_name == SEARCH_MATCH_NAME_CONTAINS || sd->match_name == SEARCH_MATCH_PATH_CONTAINS)
+ const gchar *fd_name_or_path;
+ if (sd->match_name == SEARCH_MATCH_NAME_CONTAINS)
+ {
+ fd_name_or_path = fd->name;
+ }
+ else
+ {
+ fd_name_or_path = fd->path;
+ }
if (sd->search_name_match_case)
{
if (sd->search_name_match_case)
{
- match = g_regex_match(sd->search_name_regex, fd->name, 0, NULL);
+ match = g_regex_match(sd->search_name_regex, fd_name_or_path, 0, NULL);
}
else
{
/* sd->search_name is converted in search_start() */
}
else
{
/* sd->search_name is converted in search_start() */
- gchar *haystack = g_utf8_strdown(fd->name, -1);
+ gchar *haystack = g_utf8_strdown(fd_name_or_path, -1);
match = g_regex_match(sd->search_name_regex, haystack, 0, NULL);
g_free(haystack);
}
match = g_regex_match(sd->search_name_regex, haystack, 0, NULL);
g_free(haystack);
}
sd->search_type = SEARCH_MATCH_NONE;
sd->search_type = SEARCH_MATCH_NONE;
- sd->match_name = SEARCH_MATCH_CONTAINS;
+ sd->match_name = SEARCH_MATCH_NAME_CONTAINS;
sd->match_size = SEARCH_MATCH_EQUAL;
sd->match_date = SEARCH_MATCH_EQUAL;
sd->match_dimensions = SEARCH_MATCH_EQUAL;
sd->match_size = SEARCH_MATCH_EQUAL;
sd->match_date = SEARCH_MATCH_EQUAL;
sd->match_dimensions = SEARCH_MATCH_EQUAL;
/* Search for file name */
hbox = menu_choice(sd->box_search, &sd->check_name, &sd->menu_name,
/* Search for file name */
hbox = menu_choice(sd->box_search, &sd->check_name, &sd->menu_name,
- _("File name"), &sd->match_name_enable,
+ _("File"), &sd->match_name_enable,
text_search_menu_name, sizeof(text_search_menu_name) / sizeof(MatchList),
G_CALLBACK(menu_choice_name_cb), sd);
combo = history_combo_new(&sd->entry_name, "", "search_name", -1);
text_search_menu_name, sizeof(text_search_menu_name) / sizeof(MatchList),
G_CALLBACK(menu_choice_name_cb), sd);
combo = history_combo_new(&sd->entry_name, "", "search_name", -1);
gtk_widget_show(combo);
pref_checkbox_new_int(hbox, _("Match case"),
sd->search_name_match_case, &sd->search_name_match_case);
gtk_widget_show(combo);
pref_checkbox_new_int(hbox, _("Match case"),
sd->search_name_match_case, &sd->search_name_match_case);
- gtk_widget_set_tooltip_text(GTK_WIDGET(combo), "When set to \"contains\", this field uses Perl Compatible Regular Expressions.\ne.g. use \n.*\\.jpg\n and not \n*.jpg\n\nSee the Help file.");
+ gtk_widget_set_tooltip_text(GTK_WIDGET(combo), "When set to \"contains\" or \"path contains\", this field uses Perl Compatible Regular Expressions.\ne.g. use \n.*\\.jpg\n and not \n*.jpg\n\nSee the Help file.");
/* Search for file size */
hbox = menu_choice(sd->box_search, &sd->check_size, &sd->menu_size,
/* Search for file size */
hbox = menu_choice(sd->box_search, &sd->check_size, &sd->menu_size,