diff options
author | George Lebl <jirka@5z.com> | 2001-08-31 23:36:54 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2001-08-31 23:36:54 +0000 |
commit | a176248eb5edd520bc690270fa1c7da7e720bb3e (patch) | |
tree | 0e71c74d9e06d2b04e21e8559dd52dbf535deb5f /gui | |
parent | ce534987693c428e791d5be724fb84ce704b5e84 (diff) | |
download | gdm-a176248eb5edd520bc690270fa1c7da7e720bb3e.tar.gz |
fix writing of servers to config file
Fri Aug 31 16:34:58 2001 George Lebl <jirka@5z.com>
* gui/gdmconfig.c: fix writing of servers to config file
Diffstat (limited to 'gui')
-rw-r--r-- | gui/gdmconfig.c | 34 |
1 files changed, 27 insertions, 7 deletions
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. |