don't pass a GError to the gconf_client_*() calls since we don't use it

2008-02-07  Vincent Untz  <vuntz@gnome.org>

	* preferences.c: (bg_preferences_load): don't pass a GError to the
	gconf_client_*() calls since we don't use it anyway.
	Fix bug #510421 since the crash happens because the GError wasn't
	reset to NULL between two calls.

svn path=/trunk/; revision=8453
This commit is contained in:
Vincent Untz 2008-02-06 23:21:33 +00:00 committed by Vincent Untz
parent 25235a1d87
commit f3813506ae
2 changed files with 14 additions and 8 deletions

View file

@ -1,3 +1,10 @@
2008-02-07 Vincent Untz <vuntz@gnome.org>
* preferences.c: (bg_preferences_load): don't pass a GError to the
gconf_client_*() calls since we don't use it anyway.
Fix bug #510421 since the crash happens because the GError wasn't
reset to NULL between two calls.
2008-02-06 Jens Granseuer <jensgr@gmx.net>
* Makefile.am: use LIBBACKGROUND_{CFLAGS,...} instead of CAPPLET_...

View file

@ -236,7 +236,6 @@ void
bg_preferences_load (BGPreferences *prefs)
{
GConfClient *client;
GError *error = NULL;
char *tmp;
g_return_if_fail (prefs != NULL);
@ -244,8 +243,8 @@ bg_preferences_load (BGPreferences *prefs)
client = gconf_client_get_default ();
prefs->enabled = gconf_client_get_bool (client, BG_PREFERENCES_DRAW_BACKGROUND, &error);
tmp = gconf_client_get_string (client, BG_PREFERENCES_PICTURE_FILENAME, &error);
prefs->enabled = gconf_client_get_bool (client, BG_PREFERENCES_DRAW_BACKGROUND, NULL);
tmp = gconf_client_get_string (client, BG_PREFERENCES_PICTURE_FILENAME, NULL);
if (tmp) {
if (g_utf8_validate (tmp, -1, NULL) &&
g_file_test (tmp, G_FILE_TEST_EXISTS))
@ -258,21 +257,21 @@ bg_preferences_load (BGPreferences *prefs)
if (prefs->color1 != NULL)
gdk_color_free (prefs->color1);
tmp = gconf_client_get_string (client, BG_PREFERENCES_PRIMARY_COLOR, &error);
tmp = gconf_client_get_string (client, BG_PREFERENCES_PRIMARY_COLOR, NULL);
prefs->color1 = read_color_from_string (tmp);
g_free (tmp);
if (prefs->color2 != NULL)
gdk_color_free (prefs->color2);
tmp = gconf_client_get_string (client, BG_PREFERENCES_SECONDARY_COLOR, &error);
tmp = gconf_client_get_string (client, BG_PREFERENCES_SECONDARY_COLOR, NULL);
prefs->color2 = read_color_from_string (tmp);
g_free (tmp);
prefs->opacity = gconf_client_get_int (client, BG_PREFERENCES_PICTURE_OPACITY, &error);
prefs->opacity = gconf_client_get_int (client, BG_PREFERENCES_PICTURE_OPACITY, NULL);
if (prefs->opacity >= 100 || prefs->opacity < 0)
prefs->adjust_opacity = FALSE;
tmp = gconf_client_get_string (client, BG_PREFERENCES_COLOR_SHADING_TYPE, &error);
tmp = gconf_client_get_string (client, BG_PREFERENCES_COLOR_SHADING_TYPE, NULL);
prefs->orientation = read_orientation_from_string (tmp);
g_free (tmp);
@ -281,7 +280,7 @@ bg_preferences_load (BGPreferences *prefs)
else
prefs->gradient_enabled = TRUE;
tmp = gconf_client_get_string (client, BG_PREFERENCES_PICTURE_OPTIONS, &error);
tmp = gconf_client_get_string (client, BG_PREFERENCES_PICTURE_OPTIONS, NULL);
prefs->wallpaper_type = read_wptype_from_string (tmp);
g_free (tmp);