[dconf] file-db: don't install match rules on no bus



commit 431d1126e752f03f8be91fc8ae213964284189c2
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Feb 11 17:27:47 2014 -0500

    file-db: don't install match rules on no bus
    
    file-db databases don't have an associated D-Bus bus type, so don't try
    to install match rules for them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723553

 engine/dconf-engine.c |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c
index fc5fb8b..864e8e2 100644
--- a/engine/dconf-engine.c
+++ b/engine/dconf-engine.c
@@ -813,13 +813,16 @@ dconf_engine_watch_fast (DConfEngine *engine,
   ow = dconf_engine_call_handle_new (engine, dconf_engine_watch_established,
                                      G_VARIANT_TYPE_UNIT, sizeof (OutstandingWatch));
   ow->state = dconf_engine_get_state (engine);
-  ow->pending = engine->n_sources;
 
   for (i = 0; i < engine->n_sources; i++)
-    dconf_engine_dbus_call_async_func (engine->sources[i]->bus_type, "org.freedesktop.DBus",
-                                       "/org/freedesktop/DBus", "org.freedesktop.DBus", "AddMatch",
-                                       dconf_engine_make_match_rule (engine->sources[i], path),
-                                       &ow->handle, NULL);
+    if (engine->sources[i]->bus_type)
+      {
+        dconf_engine_dbus_call_async_func (engine->sources[i]->bus_type, "org.freedesktop.DBus",
+                                           "/org/freedesktop/DBus", "org.freedesktop.DBus", "AddMatch",
+                                           dconf_engine_make_match_rule (engine->sources[i], path),
+                                           &ow->handle, NULL);
+        ow->pending++;
+      }
 }
 
 void
@@ -829,9 +832,10 @@ dconf_engine_unwatch_fast (DConfEngine *engine,
   gint i;
 
   for (i = 0; i < engine->n_sources; i++)
-    dconf_engine_dbus_call_async_func (engine->sources[i]->bus_type, "org.freedesktop.DBus",
-                                       "/org/freedesktop/DBus", "org.freedesktop.DBus", "RemoveMatch",
-                                       dconf_engine_make_match_rule (engine->sources[i], path), NULL, NULL);
+    if (engine->sources[i]->bus_type)
+      dconf_engine_dbus_call_async_func (engine->sources[i]->bus_type, "org.freedesktop.DBus",
+                                         "/org/freedesktop/DBus", "org.freedesktop.DBus", "RemoveMatch",
+                                         dconf_engine_make_match_rule (engine->sources[i], path), NULL, 
NULL);
 }
 
 static void
@@ -852,6 +856,9 @@ dconf_engine_handle_match_rule_sync (DConfEngine *engine,
     {
       GVariant *result;
 
+      if (!engine->sources[i]->bus_type)
+        continue;
+
       result = dconf_engine_dbus_call_sync_func (engine->sources[i]->bus_type, "org.freedesktop.DBus",
                                                  "/org/freedesktop/DBus", "org.freedesktop.DBus", 
method_name,
                                                  dconf_engine_make_match_rule (engine->sources[i], path),


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