diff options
author | Brian Cameron <brian.cameron@sun.com> | 2006-01-07 00:21:09 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2006-01-07 00:21:09 +0000 |
commit | 17c963105901aa1c0908bddd9bab83969918cb9b (patch) | |
tree | 331a2b80c2a4f4e535f3eb63013af700d7f369f5 /gui/gdmconfig.c | |
parent | 852427bff50ff30922b1fa201d7a922e960a8b7f (diff) | |
download | gdm-17c963105901aa1c0908bddd9bab83969918cb9b.tar.gz |
Make error message more clear when session file is invalid. Now it says
2006-01-04 Brian Cameron <brian.cameron@sun.com>
* daemon/slave.c: Make error message more clear when session file
is invalid. Now it says what session file had the problem.
This fixes bug #322699.
* gui/gdmconfig.c: Now the gdm_config_get_xserver_details
function is more robust, and handles NULL return values
better and supports PRIORITY.
* gui/gdmsetup.c: Now that gdmconfig reads in the priority value,
gdmsetup will write it back out if that server is modified.
However, gdmsetup still doesn't allow you to modify the
priority value. Probably should add a spinbutton to the
dialog.
Diffstat (limited to 'gui/gdmconfig.c')
-rw-r--r-- | gui/gdmconfig.c | 58 |
1 files changed, 49 insertions, 9 deletions
diff --git a/gui/gdmconfig.c b/gui/gdmconfig.c index bf4f4e64..b9446b2d 100644 --- a/gui/gdmconfig.c +++ b/gui/gdmconfig.c @@ -193,7 +193,6 @@ gdm_config_get_xservers (gboolean flexible) gchar *command = NULL; gchar *result = NULL; gchar *temp; - gboolean tempbool; command = g_strdup_printf ("GET_SERVER_LIST"); result = gdmcomm_call_gdm (command, NULL /* auth cookie */, @@ -221,37 +220,78 @@ gdm_config_get_xservers (gboolean flexible) while (*sec != NULL) { GdmXserver *svr = g_new0 (GdmXserver, 1); + gchar *temp; - svr->id = gdm_config_get_xserver_details (*sec, "ID"); - svr->name = gdm_config_get_xserver_details (*sec, "NAME"); - svr->command = gdm_config_get_xserver_details (*sec, "COMMAND"); + temp = gdm_config_get_xserver_details (*sec, "ID"); + if (temp == NULL) { + g_free (svr); + continue; + } + svr->id = temp; + temp = gdm_config_get_xserver_details (*sec, "NAME"); + if (temp == NULL) { + g_free (svr); + continue; + } + svr->name = temp; + temp = gdm_config_get_xserver_details (*sec, "COMMAND"); + if (temp == NULL) { + g_free (svr); + continue; + } + svr->command = temp; temp = gdm_config_get_xserver_details (*sec, "FLEXIBLE"); - if (g_strncasecmp (temp, "true", 4) == 0) + if (temp == NULL) { + g_free (svr); + continue; + } else if (g_strncasecmp (ve_sure_string (temp), "true", 4) == 0) svr->flexible = TRUE; else svr->flexible = FALSE; + temp = gdm_config_get_xserver_details (*sec, "CHOOSABLE"); - if (g_strncasecmp (temp, "true", 4) == 0) + if (temp == NULL) { + g_free (svr); + continue; + } else if (g_strncasecmp (temp, "true", 4) == 0) svr->choosable = TRUE; else svr->choosable = FALSE; + temp = gdm_config_get_xserver_details (*sec, "HANDLED"); - if (g_strncasecmp (temp, "true", 4) == 0) + if (temp == NULL) { + g_free (svr); + continue; + } else if (g_strncasecmp (temp, "true", 4) == 0) svr->handled = TRUE; else svr->handled = FALSE; + temp = gdm_config_get_xserver_details (*sec, "CHOOSER"); - if (g_strncasecmp (temp, "true", 4) == 0) + if (temp == NULL) { + g_free (svr); + continue; + } else if (g_strncasecmp (temp, "true", 4) == 0) svr->chooser = TRUE; else svr->chooser = FALSE; + temp = gdm_config_get_xserver_details (*sec, "PRIORITY"); + if (temp == NULL) { + g_free (svr); + continue; + } else { + svr->priority = atoi (temp); + } + sec++; /* If only flexible was requested, then skip if not flexible */ - if (flexible && !svr->flexible) + if (flexible && !svr->flexible) { + g_free (svr); continue; + } xservers = g_slist_append (xservers, svr); } |