Two minor checks, that fix crash/misbehaviour at broken GConf setups

This commit is contained in:
Lauris Kaplinski 2002-03-26 16:39:05 +00:00
parent 8d24cf9697
commit 2a884fd7ad
4 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2002-03-26 Lauris Kaplinski <lauris@ximian.com>
* gnome-keyboard-properties.c (bell_to_widget): Be nice on
invalid and NULL Gconf values
2002-03-25 Jody Goldberg <jody@gnome.org>
* gnome-keyboard-properties.c (volume_to_widget) : new.

View file

@ -148,12 +148,15 @@ static GConfValue *
bell_to_widget (GConfPropertyEditor *peditor, const GConfValue *value)
{
GConfValue *new_value;
const gchar *str;
gint val = 2;
str = (value && (value->type == GCONF_VALUE_STRING)) ? gconf_value_get_string (value) : NULL;
new_value = gconf_value_new (GCONF_VALUE_INT);
if (value->type == GCONF_VALUE_STRING) {
gconf_string_to_enum (bell_enums,
gconf_value_get_string (value),
str,
&val);
}
gconf_value_set_int (new_value, val);

View file

@ -1,3 +1,7 @@
2002-03-21 Lauris Kaplinski <lauris@ximian.com>
* gnome-ui-properties.c (toolbar_to_widget): Check GConf value type
2002-03-21 Dave Camp <dave@ximian.com>
* gnome-ui-properties.c: (show_handlebar), (set_toolbar_style),

View file

@ -58,11 +58,13 @@ static GConfValue *
toolbar_to_widget (GConfPropertyEditor *peditor, GConfValue *value)
{
GConfValue *new_value;
const gchar *str;
gint val = 2;
str = (value && (value->type == GCONF_VALUE_STRING)) ? gconf_value_get_string (value) : NULL;
new_value = gconf_value_new (GCONF_VALUE_INT);
gconf_string_to_enum (toolbar_style_enums,
gconf_value_get_string (value),
str,
&val);
gconf_value_set_int (new_value, val);