[dconf] engine: fix a case of variable shadowing



commit 19a05190e91de94af913075beb67725b86814231
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Nov 27 13:57:36 2013 -0500

    engine: fix a case of variable shadowing
    
    Testing uncovered a case of a shadowed variable in the signal handling
    code of the engine: the object path on which a signal arrived was being
    shadowed by the 'path' variable used when deserialising the content of
    the signal, causing the signal to fail to be delivered.
    
    Rename the D-Bus path variable to 'object_path' to avoid the issue.

 engine/dconf-engine.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c
index 33ffd57..5e1ee7e 100644
--- a/engine/dconf-engine.c
+++ b/engine/dconf-engine.c
@@ -1203,7 +1203,7 @@ dconf_engine_is_interested_in_signal (DConfEngine *engine,
 void
 dconf_engine_handle_dbus_signal (GBusType     type,
                                  const gchar *sender,
-                                 const gchar *path,
+                                 const gchar *object_path,
                                  const gchar *member,
                                  GVariant    *body)
 {
@@ -1234,7 +1234,7 @@ dconf_engine_handle_dbus_signal (GBusType     type,
            * Check last_handled to determine if we should ignore it.
            */
           if (!engine->last_handled || !g_str_equal (engine->last_handled, tag))
-            if (dconf_engine_is_interested_in_signal (engine, type, sender, path))
+            if (dconf_engine_is_interested_in_signal (engine, type, sender, object_path))
               dconf_engine_change_notify (engine, prefix, changes, tag, FALSE, NULL, engine->user_data);
 
           engines = g_slist_delete_link (engines, engines);
@@ -1264,7 +1264,7 @@ dconf_engine_handle_dbus_signal (GBusType     type,
         {
           DConfEngine *engine = engines->data;
 
-          if (dconf_engine_is_interested_in_signal (engine, type, sender, path))
+          if (dconf_engine_is_interested_in_signal (engine, type, sender, object_path))
             dconf_engine_change_notify (engine, path, empty_str_list, "", TRUE, NULL, engine->user_data);
 
           engines = g_slist_delete_link (engines, engines);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]