Mercurial > geeqie
diff src/editors.c @ 318:b16b9b8979e5
Add a new struct ConfOptions to handle options.
Changes were made among the code to use only one global var
named "options" of type ConfOptions *.
Initialization takes place in new init_options().
author | zas_ |
---|---|
date | Fri, 11 Apr 2008 22:14:36 +0000 |
parents | d1f74154463e |
children | 054a26ac407f |
line wrap: on
line diff
--- a/src/editors.c Fri Apr 11 20:35:37 2008 +0000 +++ b/src/editors.c Fri Apr 11 22:14:36 2008 +0000 @@ -100,10 +100,10 @@ for (i = 0; i < GQ_EDITOR_SLOTS; i++) { - g_free(editor_name[i]); - editor_name[i] = g_strdup(_(editor_slot_defaults[i * 2])); - g_free(editor_command[i]); - editor_command[i] = g_strdup(editor_slot_defaults[i * 2 + 1]); + g_free(options->editor_name[i]); + options->editor_name[i] = g_strdup(_(editor_slot_defaults[i * 2])); + g_free(options->editor_command[i]); + options->editor_command[i] = g_strdup(editor_slot_defaults[i * 2 + 1]); } } @@ -785,11 +785,11 @@ gint error; if (n < 0 || n >= GQ_EDITOR_SLOTS || !list || - !editor_command[n] || - strlen(editor_command[n]) == 0) return FALSE; + !options->editor_command[n] || + strlen(options->editor_command[n]) == 0) return FALSE; - command = g_locale_from_utf8(editor_command[n], -1, NULL, NULL, NULL); - error = editor_command_start(command, editor_name[n], list, cb, data); + command = g_locale_from_utf8(options->editor_command[n], -1, NULL, NULL, NULL); + error = editor_command_start(command, options->editor_name[n], list, cb, data); g_free(command); return error; } @@ -821,10 +821,10 @@ gint editor_window_flag_set(gint n) { if (n < 0 || n >= GQ_EDITOR_SLOTS || - !editor_command[n] || - strlen(editor_command[n]) == 0) return TRUE; + !options->editor_command[n] || + strlen(options->editor_command[n]) == 0) return TRUE; - return (editor_command_parse(editor_command[n], NULL, NULL) & EDITOR_KEEP_FS); + return (editor_command_parse(options->editor_command[n], NULL, NULL) & EDITOR_KEEP_FS); }