[Xfce4-commits] r30418 - in xfconf/trunk: . xfconf

Brian Tarricone kelnos at xfce.org
Wed Jul 29 23:43:07 CEST 2009


Author: kelnos
Date: 2009-07-29 21:43:07 +0000 (Wed, 29 Jul 2009)
New Revision: 30418

Modified:
   xfconf/trunk/NEWS
   xfconf/trunk/xfconf/xfconf-binding.c
Log:
revert async property fetch for bindings

with the new caching in place, this doesn't really speed things up
anymore, and was problematic to begin with.

Modified: xfconf/trunk/NEWS
===================================================================
--- xfconf/trunk/NEWS	2009-07-29 21:42:58 UTC (rev 30417)
+++ xfconf/trunk/NEWS	2009-07-29 21:43:07 UTC (rev 30418)
@@ -6,13 +6,6 @@
     in other cases.
 
 
-Xfce 4.6.2
-==========
-
-  * Speed up startup of many apps that use bindings by retrieving the
-    initial value of the binding asynchronously.
-
-
 Xfce 4.6.1
 ==========
 

Modified: xfconf/trunk/xfconf/xfconf-binding.c
===================================================================
--- xfconf/trunk/xfconf/xfconf-binding.c	2009-07-29 21:42:58 UTC (rev 30417)
+++ xfconf/trunk/xfconf/xfconf-binding.c	2009-07-29 21:43:07 UTC (rev 30418)
@@ -31,7 +31,6 @@
 #include "xfconf-private.h"
 #include "xfconf-alias.h"
 #include "xfconf-common-private.h"
-#include "xfconf-dbus-bindings.h"
 
 typedef struct
 {
@@ -44,9 +43,6 @@
     GObject *object;
     gchar *object_property;
     GType object_property_type;
-
-    /* async call to get initial value */
-    DBusGProxyCall *call;
 } XfconfGBinding;
 
 typedef struct
@@ -80,9 +76,6 @@
     if(G_UNLIKELY(!binding))
         return;
 
-    if(G_UNLIKELY(binding->call))
-        dbus_g_proxy_cancel_call(_xfconf_get_dbus_g_proxy(), binding->call);
-
     if(binding->object) {
         g_signal_handlers_disconnect_by_func(G_OBJECT(binding->object),
                                              G_CALLBACK(xfconf_g_binding_object_property_changed),
@@ -289,33 +282,6 @@
     g_value_unset(&dst_val);
 }
 
-static void
-xfconf_g_binding_initial_value_received(DBusGProxy *proxy,
-                                        GValue value,
-                                        GError *error,
-                                        gpointer user_data)
-{
-    XfconfGBinding *binding = user_data;
-
-    binding->call = NULL;
-
-    if(error) {
-#ifdef XFCONF_ENABLE_CHECKS
-        g_warning("Initial query for property \"%s\" failed: %s",
-                  binding->xfconf_property, error->message);
-#endif
-        g_error_free(error);
-        return;
-    }
-
-    xfconf_g_binding_channel_property_changed(binding->channel,
-                                              binding->xfconf_property,
-                                              &value,
-                                              binding);
-    g_value_unset(&value);
-}
-
-
 static XfconfGBinding *
 xfconf_g_binding_init(XfconfChannel *channel,
                       const gchar *xfconf_property,
@@ -325,9 +291,9 @@
                       GType object_property_type)
 {
     XfconfGBinding *binding;
-    gchar buf[1024], *channel_name = NULL;
-    gchar *property_base = NULL, *real_property;
+    gchar buf[1024];
     GSList *bindings;
+    GValue value = { 0, };
 
     binding = g_slice_new0(XfconfGBinding);
     binding->channel = channel;
@@ -374,24 +340,10 @@
                                bindings, (GDestroyNotify)g_slist_free);
     }
 
-    g_object_get(G_OBJECT(channel),
-                 "channel-name", &channel_name,
-                 "property-base", &property_base,
-                 NULL);
-    if(property_base)
-        real_property = g_strconcat(property_base, xfconf_property, NULL);
-    else
-        real_property = (gchar *)xfconf_property;
-
-    binding->call = xfconf_client_get_property_async(_xfconf_get_dbus_g_proxy(),
-                                                     channel_name,
-                                                     real_property,
-                                                     xfconf_g_binding_initial_value_received,
-                                                     binding);
-    g_free(channel_name);
-    if(property_base) {
-        g_free(property_base);
-        g_free(real_property);
+    if(xfconf_channel_get_property(channel, xfconf_property, &value)) {
+        xfconf_g_binding_channel_property_changed(channel, xfconf_property,
+                                                  &value, binding);
+        g_value_unset(&value);
     }
 
     binding->id = ++__last_binding_id;




More information about the Xfce4-commits mailing list