GList *work;
gint ln;
- if (!extension_list || options->file_filter_disable) return TRUE;
+ if (!extension_list || options->file_filter.disable) return TRUE;
ln = strlen(name);
work = extension_list;
gchar *extensions = escquote_value(fe->extensions);
gchar *description = escquote_value(fe->description);
- secure_fprintf(ssi, "filter_ext: \"%s%s\" %s %s\n",
+ secure_fprintf(ssi, "file_filter.ext: \"%s%s\" %s %s\n",
(fe->enabled) ? "" : "#",
fe->key, extensions, description);
g_free(extensions);
{
GList *work;
- if (!is_dir_list && options->file_filter_disable && options->show_dot_files) return list;
+ if (!is_dir_list && options->file_filter.disable && options->file_filter.show_dot_files) return list;
work = list;
while (work)
base = filename_from_path(name);
- if ((!options->show_dot_files && ishidden(base)) ||
+ if ((!options->file_filter.show_dot_files && ishidden(base)) ||
(!is_dir_list && !filter_name_exists(base)) ||
(is_dir_list && base[0] == '.' && (strcmp(base, GQ_CACHE_LOCAL_THUMB) == 0 ||
strcmp(base, GQ_CACHE_LOCAL_METADATA) == 0)) )
while ((dir = readdir(dp)) != NULL)
{
gchar *name = dir->d_name;
- if (options->show_dot_files || !ishidden(name))
+ if (options->file_filter.show_dot_files || !ishidden(name))
{
gchar *filepath = g_strconcat(pathl, "/", name, NULL);
if ((follow_symlinks ?
{
GList *work;
- if (!is_dir_list && options->file_filter_disable && options->show_dot_files) return list;
+ if (!is_dir_list && options->file_filter.disable && options->file_filter.show_dot_files) return list;
work = list;
while (work)
FileData *fd = (FileData *)(work->data);
const gchar *name = fd->name;
- if ((!options->show_dot_files && ishidden(name)) ||
+ if ((!options->file_filter.show_dot_files && ishidden(name)) ||
(!is_dir_list && !filter_name_exists(name)) ||
(is_dir_list && name[0] == '.' && (strcmp(name, GQ_CACHE_LOCAL_THUMB) == 0 ||
strcmp(name, GQ_CACHE_LOCAL_METADATA) == 0)) )
options->thumbnail_fast = TRUE;
options->thumbnail_spec_standard = TRUE;
options->enable_metadata_dirs = FALSE;
- options->show_dot_files = FALSE;
- options->file_filter_disable = FALSE;
+ options->file_filter.show_dot_files = FALSE;
+ options->file_filter.disable = FALSE;
options->thumbnails_enabled = FALSE;
buf = gtk_entry_get_text(GTK_ENTRY(safe_delete_path_entry));
if (buf && strlen(buf) > 0) options->safe_delete_path = remove_trailing_slash(buf);
- if (options->show_dot_files != c_options->show_dot_files) refresh = TRUE;
+ if (options->file_filter.show_dot_files != c_options->file_filter.show_dot_files) refresh = TRUE;
if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE;
- if (options->file_filter_disable != c_options->file_filter_disable) refresh = TRUE;
+ if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE;
options->startup_path_enable = c_options->startup_path_enable;
options->confirm_delete = c_options->confirm_delete;
#endif
options->thumbnail_spec_standard = c_options->thumbnail_spec_standard;
options->enable_metadata_dirs = c_options->enable_metadata_dirs;
- options->show_dot_files = c_options->show_dot_files;
+ options->file_filter.show_dot_files = c_options->file_filter.show_dot_files;
options->file_sort.case_sensitive = c_options->file_sort.case_sensitive;
- options->file_filter_disable = c_options->file_filter_disable;
+ options->file_filter.disable = c_options->file_filter.disable;
sidecar_ext_parse(gtk_entry_get_text(GTK_ENTRY(sidecar_ext_entry)), FALSE);
group = pref_box_new(vbox, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
pref_checkbox_new_int(group, _("Show entries that begin with a dot"),
- options->show_dot_files, &c_options->show_dot_files);
+ options->file_filter.show_dot_files, &c_options->file_filter.show_dot_files);
pref_checkbox_new_int(group, _("Case sensitive sort"),
options->file_sort.case_sensitive, &c_options->file_sort.case_sensitive);
ct_button = pref_checkbox_new_int(group, _("Disable File Filtering"),
- options->file_filter_disable, &c_options->file_filter_disable);
+ options->file_filter.disable, &c_options->file_filter.disable);
group = pref_group_new(vbox, FALSE, _("Grouping sidecar extensions"), GTK_ORIENTATION_VERTICAL);
frame = pref_group_parent(group);
g_signal_connect(G_OBJECT(ct_button), "toggled",
G_CALLBACK(filter_disable_cb), frame);
- gtk_widget_set_sensitive(frame, !options->file_filter_disable);
+ gtk_widget_set_sensitive(frame, !options->file_filter.disable);
scrolled = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN);
secure_fprintf(ssi, "\n##### Filtering Options #####\n\n");
- write_bool_option(ssi, "show_dotfiles", options->show_dot_files);
- write_bool_option(ssi, "disable_filtering", options->file_filter_disable);
+ write_bool_option(ssi, "file_filter.show_dot_files", options->file_filter.show_dot_files);
+ write_bool_option(ssi, "file_filter.disable", options->file_filter.disable);
filter_write_list(ssi);
/* filtering options */
- options->show_dot_files = read_bool_option(f, option,
- "show_dotfiles", value, options->show_dot_files);
- options->file_filter_disable = read_bool_option(f, option,
- "disable_filtering", value, options->file_filter_disable);
+ options->file_filter.show_dot_files = read_bool_option(f, option,
+ "file_filter.show_dot_files", value, options->file_filter.show_dot_files);
+ options->file_filter.disable = read_bool_option(f, option,
+ "file_filter.disable", value, options->file_filter.disable);
- if (strcasecmp(option, "filter_ext") == 0)
+ if (strcasecmp(option, "file_filter.ext") == 0)
{
filter_parse(value_all);
}
gint thumbnails_enabled;
/* file filtering */
- gint show_dot_files;
- gint file_filter_disable;
+ struct {
+ gint show_dot_files;
+ gint disable;
+ } file_filter;
/* collections */
struct {
/* when hidden files are not enabled, and the user enters a hidden path,
* allow the tree to display that path by specifically inserting the hidden entries
*/
- if (!options->show_dot_files &&
+ if (!options->file_filter.show_dot_files &&
target_path &&
strncmp(nd->fd->path, target_path, strlen(nd->fd->path)) == 0)
{