Move file_sort_case_sensitive to ConfOptions.
authorLaurent Monin <geeqie@norz.org>
Fri, 11 Apr 2008 22:27:54 +0000 (22:27 +0000)
committerLaurent Monin <geeqie@norz.org>
Fri, 11 Apr 2008 22:27:54 +0000 (22:27 +0000)
src/globals.c
src/main.h
src/preferences.c
src/rcfile.c
src/typedefs.h
src/ui_fileops.c
src/ui_fileops.h

index e1e49a2..ab4da77 100644 (file)
@@ -106,6 +106,8 @@ ConfOptions *init_options(ConfOptions *options)
        
        options->dupe_custom_threshold = 99;
 
+       options->file_sort_case_sensitive = FALSE;
+
        return options;
 }
 
index 4a778c8..6cf9cbb 100644 (file)
@@ -173,6 +173,8 @@ void keyboard_scroll_calc(gint *x, gint *y, GdkEventKey *event);
 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
 
index 19ad39b..38a93bb 100644 (file)
@@ -72,7 +72,6 @@ enum {
 /* 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 @@ static void config_window_apply(void)
        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 @@ static void config_window_apply(void)
        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 @@ static void config_tab_filtering(GtkWidget *notebook)
        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);
index 0b09c4b..12760d9 100644 (file)
@@ -328,7 +328,7 @@ void save_options(void)
 
        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 @@ void load_options(void)
                        "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);
index 9a6e137..12d1795 100644 (file)
@@ -819,6 +819,9 @@ struct _ConfOptions
        gint enable_read_ahead;
 
        gint place_dialogs_under_mouse;
+
+       gint file_sort_case_sensitive; /* file sorting method (case) */
+
 };
 
 #endif
index e0b17b4..8893758 100644 (file)
@@ -36,8 +36,6 @@
  *-----------------------------------------------------------------------------
  */ 
 
-/* file sorting method (case) */
-gint file_sort_case_sensitive = FALSE;
 
 
 void print_term(const gchar *text_utf8)
index 31b9190..57cc46c 100644 (file)
@@ -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);