summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2010-02-26 14:08:20 +0100
committerNick Schermer <nick@xfce.org>2010-02-26 14:11:43 +0100
commite3e16d4f8c0e6279a6ba12b01d7aa192183a73b4 (patch)
tree5055be55a3713cab9086185fadd921b1e2b4ec70 /common
parenta223dbdbf81ec37303e2df32bf6dd73b0d4882b7 (diff)
downloadxfce4-panel-e3e16d4f8c0e6279a6ba12b01d7aa192183a73b4.tar.gz
Fix some xfconf problems.
Diffstat (limited to 'common')
-rw-r--r--common/panel-xfconf.c16
-rw-r--r--common/panel-xfconf.h2
2 files changed, 7 insertions, 11 deletions
diff --git a/common/panel-xfconf.c b/common/panel-xfconf.c
index 4d0db1ce..0332046a 100644
--- a/common/panel-xfconf.c
+++ b/common/panel-xfconf.c
@@ -27,11 +27,13 @@
XfconfChannel *
-panel_properties_get_channel (void)
+panel_properties_get_channel (GObject *object_for_weak_ref)
{
GError *error = NULL;
XfconfChannel *channel;
+ panel_return_val_if_fail (G_IS_OBJECT (object_for_weak_ref), NULL);
+
if (!xfconf_init (&error))
{
g_critical ("Failed to initialize Xfconf: %s", error->message);
@@ -40,8 +42,7 @@ panel_properties_get_channel (void)
}
channel = xfconf_channel_get (XFCE_PANEL_PLUGIN_CHANNEL_NAME);
- /* TODO enable this again when Brian fixed his code
- * g_object_weak_ref (G_OBJECT (channel), (GWeakNotify) xfconf_shutdown, NULL); */
+ g_object_weak_ref (object_for_weak_ref, xfconf_shutdown, NULL);
return channel;
}
@@ -64,13 +65,8 @@ panel_properties_bind (XfconfChannel *channel,
panel_return_if_fail (properties != NULL);
if (G_LIKELY (channel == NULL))
- {
- channel = xfconf_channel_get (XFCE_PANEL_PLUGIN_CHANNEL_NAME);
- if (G_UNLIKELY (channel == NULL))
- return;
- /* TODO enable this again when Brian fixed his code
- * g_object_weak_ref (G_OBJECT (object), (GWeakNotify) g_object_unref, channel); */
- }
+ channel = panel_properties_get_channel (object);
+ panel_return_if_fail (XFCONF_IS_CHANNEL (channel));
/* walk the properties array */
for (prop = properties; prop->property != NULL; prop++)
diff --git a/common/panel-xfconf.h b/common/panel-xfconf.h
index 0551c053..760e431e 100644
--- a/common/panel-xfconf.h
+++ b/common/panel-xfconf.h
@@ -33,7 +33,7 @@ struct _PanelProperty
-XfconfChannel *panel_properties_get_channel (void);
+XfconfChannel *panel_properties_get_channel (GObject *object_for_weak_ref);
void panel_properties_bind (XfconfChannel *channel,
GObject *object,