Author: nick
Date: 2008-10-20 14:37:08 +0000 (Mon, 20 Oct 2008)
New Revision: 28325
Modified:
xfconf/trunk/xfconf/xfconf-binding.c
xfconf/trunk/xfconf/xfconf-channel.c
xfconf/trunk/xfconf/xfconf-private.h
Log:
* Fix property binding when using channel created with
xfconf_channel_new_with_property_base(). We really did
too much here ^_^, since property-changed already strips
the property_base from the signal and we use
xfconf_channel_[sg]et_* function, that implement the
property_base too.
Modified: xfconf/trunk/xfconf/xfconf-binding.c
===================================================================
--- xfconf/trunk/xfconf/xfconf-binding.c 2008-10-20 13:30:05 UTC (rev
28324)
+++ xfconf/trunk/xfconf/xfconf-binding.c 2008-10-20 14:37:08 UTC (rev
28325)
@@ -30,7 +30,6 @@
#include "xfconf.h"
#include "xfconf-alias.h"
#include "xfconf-common-private.h"
-#include "xfconf-private.h"
typedef struct
{
@@ -278,21 +277,15 @@
gchar buf[1024];
GSList *bindings;
GValue value = { 0, };
- const gchar *property_base;
binding = g_slice_new0(XfconfGBinding);
binding->channel = channel;
binding->xfconf_property_type = xfconf_property_type;
+ binding->xfconf_property = g_strdup(xfconf_property);
binding->object = object;
binding->object_property = g_strdup(object_property);
binding->object_property_type = object_property_type;
- property_base = _xfconf_channel_get_property_base(channel);
- if(G_UNLIKELY(property_base))
- binding->xfconf_property = g_strconcat(property_base, xfconf_property,
NULL);
- else
- binding->xfconf_property = g_strdup(xfconf_property);
-
g_object_weak_ref(G_OBJECT(channel),
xfconf_g_binding_channel_destroyed,
binding);
@@ -300,7 +293,7 @@
xfconf_g_binding_object_destroyed,
binding);
- g_snprintf(buf, sizeof(buf), "property-changed::%s",
binding->xfconf_property);
+ g_snprintf(buf, sizeof(buf), "property-changed::%s", xfconf_property);
g_signal_connect(G_OBJECT(channel), buf,
G_CALLBACK(xfconf_g_binding_channel_property_changed),
binding);
@@ -412,25 +405,17 @@
{
GSList *bindings = g_object_steal_data(G_OBJECT(object), DATA_KEY);
GSList *l;
- gchar *real_xfconf_property;
- const gchar *property_base;
g_return_if_fail(XFCONF_IS_CHANNEL(channel)
&& xfconf_property && *xfconf_property
&& G_IS_OBJECT(object)
&& object_property && *object_property);
- property_base = _xfconf_channel_get_property_base(channel);
- if(G_UNLIKELY (property_base))
- real_xfconf_property = g_strconcat(property_base, xfconf_property,
NULL);
- else
- real_xfconf_property = (gchar *)xfconf_property;
-
for(l = bindings; l; l = l->next) {
XfconfGBinding *binding = l->data;
if(channel == binding->channel
- && !strcmp(real_xfconf_property, binding->xfconf_property)
+ && !strcmp(xfconf_property, binding->xfconf_property)
&& !strcmp(object_property, binding->object_property))
{
bindings = g_slist_delete_link(bindings, l);
@@ -439,9 +424,6 @@
}
}
- if(real_xfconf_property != xfconf_property)
- g_free(real_xfconf_property);
-
if(bindings) {
g_object_set_data_full(G_OBJECT(object), DATA_KEY,
bindings, (GDestroyNotify)g_slist_free);
Modified: xfconf/trunk/xfconf/xfconf-channel.c
===================================================================
--- xfconf/trunk/xfconf/xfconf-channel.c 2008-10-20 13:30:05 UTC (rev
28324)
+++ xfconf/trunk/xfconf/xfconf-channel.c 2008-10-20 14:37:08 UTC (rev
28325)
@@ -285,13 +285,6 @@
}
-const gchar *
-_xfconf_channel_get_property_base(XfconfChannel *channel)
-{
- return channel->property_base;
-}
-
-
static void
xfconf_channel_property_changed(DBusGProxy *proxy,
const gchar *channel_name,
Modified: xfconf/trunk/xfconf/xfconf-private.h
===================================================================
--- xfconf/trunk/xfconf/xfconf-private.h 2008-10-20 13:30:05 UTC (rev
28324)
+++ xfconf/trunk/xfconf/xfconf-private.h 2008-10-20 14:37:08 UTC (rev
28325)
@@ -30,8 +30,6 @@
DBusGProxy *_xfconf_get_dbus_g_proxy();
DBusGProxy *_xfconf_get_gui_dbus_g_proxy();
-const gchar *_xfconf_channel_get_property_base(XfconfChannel *channel);
-
XfconfNamedStruct *_xfconf_named_struct_lookup(const gchar *struct_name);
void _xfconf_channel_shutdown();
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits