changeset 629:1fa2cb6d9d65

Rename options: startup_path_enable -> startup.restore_path startup_path -> startup.path Geeqie is still able to read old options.
author zas_
date Sun, 11 May 2008 12:23:26 +0000
parents bbe8e71cdfb2
children 83d3ded39e49
files src/main.c src/options.c src/options.h src/preferences.c src/rcfile.c
diffstat 5 files changed, 28 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.c	Sun May 11 11:46:48 2008 +0000
+++ b/src/main.c	Sun May 11 12:23:26 2008 +0000
@@ -1382,9 +1382,9 @@
 		{
 		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
 		{
--- a/src/options.c	Sun May 11 11:46:48 2008 +0000
+++ b/src/options.c	Sun May 11 12:23:26 2008 +0000
@@ -127,8 +127,8 @@
 	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;
--- a/src/options.h	Sun May 11 11:46:48 2008 +0000
+++ b/src/options.h	Sun May 11 12:23:26 2008 +0000
@@ -25,8 +25,6 @@
 	gint show_copy_path;
 
 	/* various */
-	gint startup_path_enable;
-	gchar *startup_path;
 	gint enable_metadata_dirs;
 
 	gint tree_descend_subdirs;
@@ -41,6 +39,11 @@
 
 	gint save_metadata_in_image_file;
 
+	struct {
+		gboolean restore_path;
+		gchar *path;
+	} startup;
+
 	/* file ops */
 	struct {
 		gint enable_in_place_rename;
--- a/src/preferences.c	Sun May 11 11:46:48 2008 +0000
+++ b/src/preferences.c	Sun May 11 12:23:26 2008 +0000
@@ -173,10 +173,10 @@
 		}
 	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 @@
 	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 @@
 	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);
--- a/src/rcfile.c	Sun May 11 11:46:48 2008 +0000
+++ b/src/rcfile.c	Sun May 11 12:23:26 2008 +0000
@@ -309,9 +309,6 @@
 	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 @@
 	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 @@
 		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 @@
 		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);