changeset 319:f9611a6cf0e2

Move file_sort_case_sensitive to ConfOptions.
author zas_
date Fri, 11 Apr 2008 22:27:54 +0000
parents b16b9b8979e5
children c74af1cbd61a
files src/globals.c src/main.h src/preferences.c src/rcfile.c src/typedefs.h src/ui_fileops.c src/ui_fileops.h
diffstat 7 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/globals.c	Fri Apr 11 22:14:36 2008 +0000
+++ b/src/globals.c	Fri Apr 11 22:27:54 2008 +0000
@@ -106,6 +106,8 @@
 	
 	options->dupe_custom_threshold = 99;
 
+	options->file_sort_case_sensitive = FALSE;
+
 	return options;
 }
 
--- a/src/main.h	Fri Apr 11 22:14:36 2008 +0000
+++ b/src/main.h	Fri Apr 11 22:27:54 2008 +0000
@@ -173,6 +173,8 @@
 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)) )
+
 
 #endif
 
--- a/src/preferences.c	Fri Apr 11 22:14:36 2008 +0000
+++ b/src/preferences.c	Fri Apr 11 22:27:54 2008 +0000
@@ -72,7 +72,6 @@
 /* config memory values */
 static ConfOptions *options_c = NULL;
 
-static int file_sort_case_sensitive_c;
 
 #ifdef DEBUG
 static gint debug_c;
@@ -185,7 +184,7 @@
 	if (buf && strlen(buf) > 0) options->safe_delete_path = remove_trailing_slash(buf);
 
 	if (options->show_dot_files != options_c->show_dot_files) refresh = TRUE;
-	if (file_sort_case_sensitive != file_sort_case_sensitive_c) refresh = TRUE;
+	if (options->file_sort_case_sensitive != options_c->file_sort_case_sensitive) refresh = TRUE;
 	if (options->file_filter_disable != options_c->file_filter_disable) refresh = TRUE;
 
 	options->startup_path_enable = options_c->startup_path_enable;
@@ -215,7 +214,7 @@
 	options->thumbnail_spec_standard = options_c->thumbnail_spec_standard;
 	options->enable_metadata_dirs = options_c->enable_metadata_dirs;
 	options->show_dot_files = options_c->show_dot_files;
-	file_sort_case_sensitive = file_sort_case_sensitive_c;
+	options->file_sort_case_sensitive = options_c->file_sort_case_sensitive;
 	options->file_filter_disable = options_c->file_filter_disable;
 
 	sidecar_ext_parse(gtk_entry_get_text(GTK_ENTRY(sidecar_ext_entry)), FALSE);
@@ -1012,7 +1011,7 @@
 	pref_checkbox_new_int(group, _("Show entries that begin with a dot"),
 			      options->show_dot_files, &options_c->show_dot_files);
 	pref_checkbox_new_int(group, _("Case sensitive sort"),
-			      file_sort_case_sensitive, &file_sort_case_sensitive_c);
+			      options->file_sort_case_sensitive, &options_c->file_sort_case_sensitive);
 
 	ct_button = pref_checkbox_new_int(group, _("Disable File Filtering"),
 					  options->file_filter_disable, &options_c->file_filter_disable);
--- a/src/rcfile.c	Fri Apr 11 22:14:36 2008 +0000
+++ b/src/rcfile.c	Fri Apr 11 22:27:54 2008 +0000
@@ -328,7 +328,7 @@
 
 	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", file_sort_case_sensitive);
+	write_bool_option(ssi, "sort_case_sensitive", options->file_sort_case_sensitive);
 	secure_fputc(ssi, '\n');
 
 	write_bool_option(ssi, "confirm_delete", options->confirm_delete);
@@ -604,8 +604,8 @@
 			"sort_method", value, (gint)options->file_sort_method);
 		options->file_sort_ascending = read_bool_option(f, option,
 			"sort_ascending", value, options->file_sort_ascending);
-		file_sort_case_sensitive = read_bool_option(f, option,
-			"sort_case_sensitive", value, file_sort_case_sensitive);
+		options->file_sort_case_sensitive = read_bool_option(f, option,
+			"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	Fri Apr 11 22:14:36 2008 +0000
+++ b/src/typedefs.h	Fri Apr 11 22:27:54 2008 +0000
@@ -819,6 +819,9 @@
 	gint enable_read_ahead;
 
 	gint place_dialogs_under_mouse;
+
+	gint file_sort_case_sensitive; /* file sorting method (case) */
+
 };
 
 #endif
--- a/src/ui_fileops.c	Fri Apr 11 22:14:36 2008 +0000
+++ b/src/ui_fileops.c	Fri Apr 11 22:27:54 2008 +0000
@@ -36,8 +36,6 @@
  *-----------------------------------------------------------------------------
  */ 
 
-/* file sorting method (case) */
-gint file_sort_case_sensitive = FALSE;
 
 
 void print_term(const gchar *text_utf8)
--- a/src/ui_fileops.h	Fri Apr 11 22:14:36 2008 +0000
+++ b/src/ui_fileops.h	Fri Apr 11 22:27:54 2008 +0000
@@ -20,9 +20,6 @@
 #include <time.h>
 
 
-#define CASE_SORT(a, b) ( (file_sort_case_sensitive) ? strcmp(a, b) : strcasecmp(a, b) )
-
-extern gint file_sort_case_sensitive;
 
 void print_term(const gchar *text_utf8);