diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | gui/gdmconfig.c | 34 |
2 files changed, 31 insertions, 7 deletions
@@ -1,3 +1,7 @@ +Fri Aug 31 16:34:58 2001 George Lebl <jirka@5z.com> + + * gui/gdmconfig.c: fix writing of servers to config file + 2001-08-31 Abel Cheung <maddog@linux.org.hk> * configure.in (ALL_LINGUAS): zh_TW.Big5 -> zh_TW diff --git a/gui/gdmconfig.c b/gui/gdmconfig.c index 8b10d121..0c44f5f2 100644 --- a/gui/gdmconfig.c +++ b/gui/gdmconfig.c @@ -1448,13 +1448,33 @@ write_config (void) /* Write out the widget contents of the Servers tab */ - for (i=0; i<number_of_servers; i++) - { - char *current_server; - gtk_clist_get_text(GTK_CLIST(get_widget("server_clist")), - i, 1, ¤t_server); - gnome_config_set_string(g_strdup_printf("%d", i), current_server); - } + for (i = 0; i < number_of_servers; i++) { + char *key; + char *val; + char *extra_args = NULL; + char *current_server = + gtk_clist_get_row_data (GTK_CLIST (get_widget ("server_clist")), i); + g_print ("foo %d: %s\n", i, current_server); + + if (ve_string_empty (current_server)) + continue; + + gtk_clist_get_text (GTK_CLIST (get_widget ("server_clist")), + i, 2, &extra_args); + + if (ve_string_empty (extra_args)) + val = g_strdup (current_server); + else + val = g_strdup_printf ("%s %s", current_server, + extra_args); + + + key = g_strdup_printf ("%d", i); + g_print ("%s=%s\n", key, val); + gnome_config_set_string(key, val); + g_free (key); + g_free (val); + } /* It would be nice to be able to do some paranoid sanity checking on * more of this stuff. |