changeset 332:3c4bad726e98

Rename file filtering options.
author zas_
date Sat, 12 Apr 2008 09:12:37 +0000
parents d8e285551598
children 767b53cd9ab7
files src/filelist.c src/globals.c src/preferences.c src/rcfile.c src/typedefs.h src/view_dir_tree.c
diffstat 6 files changed, 28 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/src/filelist.c	Sat Apr 12 08:59:52 2008 +0000
+++ b/src/filelist.c	Sat Apr 12 09:12:37 2008 +0000
@@ -318,7 +318,7 @@
 	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;
@@ -378,7 +378,7 @@
 		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);
@@ -423,7 +423,7 @@
 {
 	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)
@@ -433,7 +433,7 @@
 
 		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)) )
@@ -1220,7 +1220,7 @@
 	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 ? 
@@ -1349,7 +1349,7 @@
 {
 	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)
@@ -1357,7 +1357,7 @@
 		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)) )
--- a/src/globals.c	Sat Apr 12 08:59:52 2008 +0000
+++ b/src/globals.c	Sat Apr 12 09:12:37 2008 +0000
@@ -67,8 +67,8 @@
 	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;
--- a/src/preferences.c	Sat Apr 12 08:59:52 2008 +0000
+++ b/src/preferences.c	Sat Apr 12 09:12:37 2008 +0000
@@ -178,9 +178,9 @@
 	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;
@@ -208,9 +208,9 @@
 #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);
 
@@ -1004,12 +1004,12 @@
 	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);
@@ -1024,7 +1024,7 @@
 	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);
--- a/src/rcfile.c	Sat Apr 12 08:59:52 2008 +0000
+++ b/src/rcfile.c	Sat Apr 12 09:12:37 2008 +0000
@@ -379,8 +379,8 @@
 
 	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);
 	
@@ -687,12 +687,12 @@
 
 		/* 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);
 			}
--- a/src/typedefs.h	Sat Apr 12 08:59:52 2008 +0000
+++ b/src/typedefs.h	Sat Apr 12 09:12:37 2008 +0000
@@ -813,8 +813,10 @@
 	gint thumbnails_enabled;
 
 	/* file filtering */
-	gint show_dot_files;
-	gint file_filter_disable;
+	struct {
+		gint show_dot_files;
+		gint disable;
+	} file_filter;
 
 	/* collections */
 	struct {
--- a/src/view_dir_tree.c	Sat Apr 12 08:59:52 2008 +0000
+++ b/src/view_dir_tree.c	Sat Apr 12 09:12:37 2008 +0000
@@ -1062,7 +1062,7 @@
 	/* 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)
 		{