Skip to content

Commit

Permalink
Rename options:
Browse files Browse the repository at this point in the history
startup_path_enable -> startup.restore_path
startup_path        -> startup.path

Geeqie is still able to read old options.
  • Loading branch information
Laurent Monin committed May 11, 2008
1 parent 4e0f18a commit ff3bbba
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
19 changes: 13 additions & 6 deletions src/rcfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit ff3bbba

Please sign in to comment.