gnome-power-manager r2798 - in trunk: . src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-power-manager r2798 - in trunk: . src
- Date: Mon, 19 May 2008 13:40:19 +0000 (UTC)
Author: rhughes
Date: Mon May 19 13:40:19 2008
New Revision: 2798
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=2798&view=rev
Log:
2008-05-15 Richard Hughes <richard hughsie com>
* src/gpm-conf.c: (gpm_conf_set_bool), (gpm_conf_set_string),
(gpm_conf_set_int):
Check keys for writability before we try to change them. Fixes rh#444026
Modified:
trunk/ChangeLog
trunk/src/gpm-conf.c
Modified: trunk/src/gpm-conf.c
==============================================================================
--- trunk/src/gpm-conf.c (original)
+++ trunk/src/gpm-conf.c Mon May 19 13:40:19 2008
@@ -189,13 +189,18 @@
g_return_val_if_fail (GPM_IS_CONF (conf), FALSE);
g_return_val_if_fail (key != NULL, FALSE);
+ ret = gconf_client_key_is_writable (conf->priv->gconf_client, key, NULL);
+ if (!ret) {
+ gpm_debug ("%s not writable", key);
+ goto out;
+ }
gconf_client_set_bool (conf->priv->gconf_client, key, value, &error);
if (error) {
gpm_debug ("Error: %s", error->message);
g_error_free (error);
ret = FALSE;
}
-
+out:
return ret;
}
@@ -221,13 +226,18 @@
g_return_val_if_fail (key != NULL, FALSE);
g_return_val_if_fail (value != NULL, FALSE);
+ ret = gconf_client_key_is_writable (conf->priv->gconf_client, key, NULL);
+ if (!ret) {
+ gpm_debug ("%s not writable", key);
+ goto out;
+ }
gconf_client_set_string (conf->priv->gconf_client, key, value, &error);
if (error) {
gpm_debug ("Error: %s", error->message);
g_error_free (error);
ret = FALSE;
}
-
+out:
return ret;
}
@@ -250,13 +260,18 @@
g_return_val_if_fail (GPM_IS_CONF (conf), FALSE);
g_return_val_if_fail (key != NULL, FALSE);
+ ret = gconf_client_key_is_writable (conf->priv->gconf_client, key, NULL);
+ if (!ret) {
+ gpm_debug ("%s not writable", key);
+ goto out;
+ }
gconf_client_set_int (conf->priv->gconf_client, key, value, &error);
if (error) {
gpm_debug ("Error: %s", error->message);
g_error_free (error);
ret = FALSE;
}
-
+out:
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]