Rename options:
authorLaurent Monin <geeqie@norz.org>
Sun, 11 May 2008 12:23:26 +0000 (12:23 +0000)
committerLaurent Monin <geeqie@norz.org>
Sun, 11 May 2008 12:23:26 +0000 (12:23 +0000)
startup_path_enable -> startup.restore_path
startup_path        -> startup.path

Geeqie is still able to read old options.

src/main.c
src/options.c
src/options.h
src/preferences.c
src/rcfile.c

index 8aefe18..ae8c714 100644 (file)
@@ -1382,9 +1382,9 @@ int main (int argc, char *argv[])
                {
                path = g_strdup(cmd_path);
                }
-       else if (options->startup_path_enable && options->startup_path && isdir(options->startup_path))
+       else if (options->startup.restore_path && options->startup.path && isdir(options->startup.path))
                {
-               path = g_strdup(options->startup_path);
+               path = g_strdup(options->startup.path);
                }
        else
                {
index 2698564..dbb8bdc 100644 (file)
@@ -127,8 +127,8 @@ ConfOptions *init_options(ConfOptions *options)
        options->slideshow.random = FALSE;
        options->slideshow.repeat = FALSE;
 
-       options->startup_path_enable = FALSE;
-       options->startup_path = NULL;
+       options->startup.restore_path = FALSE;
+       options->startup.path = NULL;
 
        options->thumbnails.cache_into_dirs = FALSE;
        options->thumbnails.enable_caching = TRUE;
index 2d498ef..f38a14b 100644 (file)
@@ -25,8 +25,6 @@ struct _ConfOptions
        gint show_copy_path;
 
        /* various */
-       gint startup_path_enable;
-       gchar *startup_path;
        gint enable_metadata_dirs;
 
        gint tree_descend_subdirs;
@@ -41,6 +39,11 @@ struct _ConfOptions
 
        gint save_metadata_in_image_file;
 
+       struct {
+               gboolean restore_path;
+               gchar *path;
+       } startup;
+
        /* file ops */
        struct {
                gint enable_in_place_rename;
index fec0bf4..f633fee 100644 (file)
@@ -173,10 +173,10 @@ static void config_window_apply(void)
                }
        layout_edit_update_all();
 
-       g_free(options->startup_path);
-       options->startup_path = NULL;
+       g_free(options->startup.path);
+       options->startup.path = NULL;
        buf = gtk_entry_get_text(GTK_ENTRY(startup_path_entry));
-       if (buf && strlen(buf) > 0) options->startup_path = remove_trailing_slash(buf);
+       if (buf && strlen(buf) > 0) options->startup.path = remove_trailing_slash(buf);
 
        g_free(options->file_ops.safe_delete_path);
        options->file_ops.safe_delete_path = NULL;
@@ -188,7 +188,7 @@ static void config_window_apply(void)
        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;
+       options->startup.restore_path = c_options->startup.restore_path;
        options->file_ops.confirm_delete = c_options->file_ops.confirm_delete;
        options->file_ops.enable_delete_key = c_options->file_ops.enable_delete_key;
        options->file_ops.safe_delete_enable = c_options->file_ops.safe_delete_enable;
@@ -858,12 +858,12 @@ static void config_tab_general(GtkWidget *notebook)
        group = pref_group_new(vbox, FALSE, _("Startup"), GTK_ORIENTATION_VERTICAL);
 
        button = pref_checkbox_new_int(group, _("Change to folder:"),
-                                      options->startup_path_enable, &c_options->startup_path_enable);
+                                      options->startup.restore_path, &c_options->startup.restore_path);
 
        hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
        pref_checkbox_link_sensitivity(button, hbox);
 
-       tabcomp = tab_completion_new(&startup_path_entry, options->startup_path, NULL, NULL);
+       tabcomp = tab_completion_new(&startup_path_entry, options->startup.path, NULL, NULL);
        tab_completion_add_select_button(startup_path_entry, NULL, TRUE);
        gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0);
        gtk_widget_show(tabcomp);
index 51703ed..ee949f8 100644 (file)
@@ -309,9 +309,6 @@ void save_options(void)
        WRITE_BOOL(update_on_time_change);
        WRITE_SEPARATOR();
 
-       WRITE_BOOL(startup_path_enable);
-       WRITE_CHAR(startup_path);
-
        WRITE_BOOL(progressive_key_scrolling);
        WRITE_BOOL(enable_metadata_dirs);
        WRITE_BOOL(save_metadata_in_image_file);
@@ -325,6 +322,12 @@ void save_options(void)
        WRITE_BOOL(place_dialogs_under_mouse);
 
 
+       WRITE_SUBTITLE("Startup Options");
+
+       WRITE_BOOL(startup.restore_path);
+       WRITE_CHAR(startup.path);
+
+
        WRITE_SUBTITLE("File operations Options");
 
        WRITE_BOOL(file_ops.enable_in_place_rename);
@@ -625,9 +628,6 @@ void load_options(void)
                READ_BOOL(lazy_image_sync);
                READ_BOOL(update_on_time_change);
 
-               READ_BOOL(startup_path_enable);
-               READ_CHAR(startup_path);
-
                READ_INT(duplicates_similarity_threshold);
 
                READ_BOOL(progressive_key_scrolling);
@@ -641,7 +641,14 @@ void load_options(void)
                READ_INT(dnd_icon_size);
                READ_BOOL(place_dialogs_under_mouse);
 
+               /* startup options */
+               
+               COMPAT_READ_BOOL(startup_path_enable, startup.restore_path); /* 2008/05/11 */
+               READ_BOOL(startup.restore_path);
 
+               COMPAT_READ_CHAR(startup_path, startup.path); /* 2008/05/11 */
+               READ_CHAR(startup.path);
+       
                /* layout options */
 
                READ_INT(layout.style);