[Xfce4-commits] <xfce4-panel:devel> Add function for an xfconf channel singleton.
Nick Schermer
nick at xfce.org
Tue Aug 11 20:34:33 CEST 2009
Updating branch refs/heads/devel
to 6d98e962a48e30a859dfb5ca050d450809d6024a (commit)
from a7029764f0ccc6e49a87d26c36ce8b1794892f93 (commit)
commit 6d98e962a48e30a859dfb5ca050d450809d6024a
Author: Nick Schermer <nick at xfce.org>
Date: Mon Jun 1 09:34:07 2009 +0200
Add function for an xfconf channel singleton.
common/panel-xfconf.c | 15 +++++++++++++++
common/panel-xfconf.h | 14 ++++++++------
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/common/panel-xfconf.c b/common/panel-xfconf.c
index 86d6ea6..30b6a9c 100644
--- a/common/panel-xfconf.c
+++ b/common/panel-xfconf.c
@@ -151,6 +151,21 @@ panel_properties_channel_destroyed (gpointer user_data,
+XfconfChannel *
+panel_properties_get_channel (void)
+{
+ static XfconfChannel *channel = NULL;
+
+ if (G_UNLIKELY (channel == NULL))
+ channel = xfconf_channel_new (XFCE_PANEL_PLUGIN_CHANNEL_NAME);
+ else
+ g_object_ref (G_OBJECT (channel));
+
+ return channel;
+}
+
+
+
void
panel_properties_bind (XfconfChannel *channel,
GObject *object,
diff --git a/common/panel-xfconf.h b/common/panel-xfconf.h
index a74d43f..db58f2f 100644
--- a/common/panel-xfconf.h
+++ b/common/panel-xfconf.h
@@ -29,13 +29,15 @@ struct _PanelProperty
GType type;
};
-void panel_properties_bind (XfconfChannel *channel,
- GObject *object,
- const gchar *property_base,
- const PanelProperty *properties);
+XfconfChannel *panel_properties_get_channel (void);
-void panel_properties_unbind (GObject *object);
+void panel_properties_bind (XfconfChannel *channel,
+ GObject *object,
+ const gchar *property_base,
+ const PanelProperty *properties);
-void panel_properties_shared_hash_table (GHashTable *hash_table);
+void panel_properties_unbind (GObject *object);
+
+void panel_properties_shared_hash_table (GHashTable *hash_table);
#endif /* !__PANEL_XFCONF_H__ */
More information about the Xfce4-commits
mailing list