changeset 329:a51242c032ea

Rename file sorting options.
author zas_
date Sat, 12 Apr 2008 08:35:58 +0000
parents a742c200b2e4
children 57a4ced53618
files src/globals.c src/layout_util.c src/main.c src/main.h src/preferences.c src/rcfile.c src/typedefs.h
diffstat 7 files changed, 24 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/globals.c	Sat Apr 12 08:28:08 2008 +0000
+++ b/src/globals.c	Sat Apr 12 08:35:58 2008 +0000
@@ -72,8 +72,8 @@
 	
 	
 	options->thumbnails_enabled = FALSE;
-	options->file_sort_method = SORT_NAME;
-	options->file_sort_ascending = TRUE;
+	options->file_sort.method = SORT_NAME;
+	options->file_sort.ascending = TRUE;
 	
 	options->slideshow.delay = 150;
 	options->slideshow.random = FALSE;
@@ -109,7 +109,7 @@
 	
 	options->dupe_custom_threshold = 99;
 
-	options->file_sort_case_sensitive = FALSE;
+	options->file_sort.case_sensitive = FALSE;
 
 	/* layout */
 	options->layout.order = NULL;
--- a/src/layout_util.c	Sat Apr 12 08:28:08 2008 +0000
+++ b/src/layout_util.c	Sat Apr 12 08:35:58 2008 +0000
@@ -255,7 +255,7 @@
 		layout_image_full_screen_stop(lw);
 
 	nw = layout_new(NULL, FALSE, FALSE);
-	layout_sort_set(nw, options->file_sort_method, options->file_sort_ascending);
+	layout_sort_set(nw, options->file_sort.method, options->file_sort.ascending);
 	layout_set_path(nw, layout_get_path(lw));
 }
 
--- a/src/main.c	Sat Apr 12 08:28:08 2008 +0000
+++ b/src/main.c	Sat Apr 12 08:35:58 2008 +0000
@@ -1212,7 +1212,7 @@
 	layout_views_get(NULL, &options->layout.view_as_tree, &options->layout.view_as_icons);
 
 	options->thumbnails_enabled = layout_thumb_get(NULL);
-	layout_sort_get(NULL, &options->file_sort_method, &options->file_sort_ascending);
+	layout_sort_get(NULL, &options->file_sort.method, &options->file_sort.ascending);
 
 	layout_geometry_get_tools(NULL, &options->float_window_x, &options->float_window_y,
 				  &options->float_window_w, &options->float_window_h, &options->float_window_divider);
@@ -1394,7 +1394,7 @@
 		}
 
 	lw = layout_new_with_geometry(NULL, options->tools_float, options->tools_hidden, geometry);
-	layout_sort_set(lw, options->file_sort_method, options->file_sort_ascending);
+	layout_sort_set(lw, options->file_sort.method, options->file_sort.ascending);
 
 	if (collection_list && !startup_command_line_collection)
 		{
--- a/src/main.h	Sat Apr 12 08:28:08 2008 +0000
+++ b/src/main.h	Sat Apr 12 08:35:58 2008 +0000
@@ -143,7 +143,7 @@
 gint key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
 void exit_program(void);
 
-#define CASE_SORT(a, b) ( (options->file_sort_case_sensitive) ? strcmp((a), (b)) : strcasecmp((a), (b)) )
+#define CASE_SORT(a, b) ( (options->file_sort.case_sensitive) ? strcmp((a), (b)) : strcasecmp((a), (b)) )
 
 
 #endif
--- a/src/preferences.c	Sat Apr 12 08:28:08 2008 +0000
+++ b/src/preferences.c	Sat Apr 12 08:35:58 2008 +0000
@@ -179,7 +179,7 @@
 	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_sort_case_sensitive != c_options->file_sort_case_sensitive) 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;
 
 	options->startup_path_enable = c_options->startup_path_enable;
@@ -209,7 +209,7 @@
 	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_sort_case_sensitive = c_options->file_sort_case_sensitive;
+	options->file_sort.case_sensitive = c_options->file_sort.case_sensitive;
 	options->file_filter_disable = c_options->file_filter_disable;
 
 	sidecar_ext_parse(gtk_entry_get_text(GTK_ENTRY(sidecar_ext_entry)), FALSE);
@@ -1006,7 +1006,7 @@
 	pref_checkbox_new_int(group, _("Show entries that begin with a dot"),
 			      options->show_dot_files, &c_options->show_dot_files);
 	pref_checkbox_new_int(group, _("Case sensitive sort"),
-			      options->file_sort_case_sensitive, &c_options->file_sort_case_sensitive);
+			      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);
--- a/src/rcfile.c	Sat Apr 12 08:28:08 2008 +0000
+++ b/src/rcfile.c	Sat Apr 12 08:35:58 2008 +0000
@@ -326,9 +326,9 @@
 	write_bool_option(ssi, "local_metadata", options->enable_metadata_dirs);
 	secure_fputc(ssi, '\n');
 
-	write_int_option(ssi, "sort_method", (gint)options->file_sort_method);
-	write_bool_option(ssi, "sort_ascending", options->file_sort_ascending);
-	write_bool_option(ssi, "sort_case_sensitive", options->file_sort_case_sensitive);
+	write_int_option(ssi, "file_sort.method", (gint)options->file_sort.method);
+	write_bool_option(ssi, "file_sort.ascending", options->file_sort.ascending);
+	write_bool_option(ssi, "file_sort.case_sensitive", options->file_sort.case_sensitive);
 	secure_fputc(ssi, '\n');
 
 	write_bool_option(ssi, "confirm_delete", options->confirm_delete);
@@ -600,12 +600,12 @@
 		options->enable_metadata_dirs = read_bool_option(f, option,
 			"local_metadata", value, options->enable_metadata_dirs);
 
-		options->file_sort_method = (SortType)read_int_option(f, option,
-			"sort_method", value, (gint)options->file_sort_method);
-		options->file_sort_ascending = read_bool_option(f, option,
-			"sort_ascending", value, options->file_sort_ascending);
-		options->file_sort_case_sensitive = read_bool_option(f, option,
-			"sort_case_sensitive", value, options->file_sort_case_sensitive);
+		options->file_sort.method = (SortType)read_int_option(f, option,
+			"file_sort.method", value, (gint)options->file_sort.method);
+		options->file_sort.ascending = read_bool_option(f, option,
+			"file_sort.ascending", value, options->file_sort.ascending);
+		options->file_sort.case_sensitive = read_bool_option(f, option,
+			"file_sort.case_sensitive", value, options->file_sort.case_sensitive);
 
 		options->confirm_delete = read_bool_option(f, option,
 			"confirm_delete", value, options->confirm_delete);
--- a/src/typedefs.h	Sat Apr 12 08:28:08 2008 +0000
+++ b/src/typedefs.h	Sat Apr 12 08:35:58 2008 +0000
@@ -825,9 +825,11 @@
 	gchar *editor_command[GQ_EDITOR_SLOTS];
 
 	/* file sorting */
-	SortType file_sort_method;
-	gint file_sort_ascending;
-	gint file_sort_case_sensitive; /* file sorting method (case) */
+	struct {
+		SortType method;
+		gint ascending;
+		gint case_sensitive; /* file sorting method (case) */
+	} file_sort;
 
 	/* slideshow */
 	struct {