summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorAlban Crequy <alban.crequy@collabora.co.uk>2009-10-09 17:43:00 +0200
committerChristian Kellner <gicmo@gnome.org>2009-10-09 17:46:30 +0200
commit8a540ab974ea032727ec0447ae678f9417d48103 (patch)
tree010a6fda2019619edd9beeda1d909c93312ba822 /monitor
parent4685f9e982f4c6884a21a0bd80d512a4ea0162db (diff)
downloadgvfs-8a540ab974ea032727ec0447ae678f9417d48103.tar.gz
Don't subscribe to unnecessary HAL D-Bus events
Fixes bug 597827
Diffstat (limited to 'monitor')
-rw-r--r--monitor/hal/hal-device.c7
-rw-r--r--monitor/hal/hal-pool.c7
2 files changed, 7 insertions, 7 deletions
diff --git a/monitor/hal/hal-device.c b/monitor/hal/hal-device.c
index 9f0b5bc3..68eddb65 100644
--- a/monitor/hal/hal-device.c
+++ b/monitor/hal/hal-device.c
@@ -44,6 +44,9 @@ G_DEFINE_TYPE (HalDevice, hal_device, G_TYPE_OBJECT)
static void
hal_device_finalize (HalDevice *device)
{
+ libhal_device_remove_property_watch (device->priv->hal_ctx,
+ device->priv->udi, NULL);
+
if (device->priv->properties != NULL)
libhal_free_property_set (device->priv->properties);
g_free (device->priv->udi);
@@ -222,6 +225,8 @@ HalDevice *
hal_device_new_from_udi (LibHalContext *hal_ctx, const char *udi)
{
HalDevice *device;
+
+ libhal_device_add_property_watch (hal_ctx, udi, NULL);
device = HAL_DEVICE (g_object_new (HAL_TYPE_DEVICE, NULL));
device->priv->udi = g_strdup (udi);
@@ -237,6 +242,8 @@ hal_device_new_from_udi_and_properties (LibHalContext *hal_ctx,
{
HalDevice *device;
+ libhal_device_add_property_watch (hal_ctx, udi, NULL);
+
device = HAL_DEVICE (g_object_new (HAL_TYPE_DEVICE, NULL));
device->priv->udi = g_strdup (udi);
device->priv->hal_ctx = hal_ctx;
diff --git a/monitor/hal/hal-pool.c b/monitor/hal/hal-pool.c
index 770effd9..b6d7faad 100644
--- a/monitor/hal/hal-pool.c
+++ b/monitor/hal/hal-pool.c
@@ -327,13 +327,6 @@ hal_pool_new (char **cap_only)
pool->priv->devices = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
pool->priv->cap_only = g_strdupv (cap_only);
- /* Gah, unfortunately we have to watch all devices as HAL's PropertyModified signal
- * doesn't include the capabilities...
- */
- dbus_bus_add_match (dbus_connection,
- "type='signal',"
- "interface='org.freedesktop.Hal.Device',"
- "sender='org.freedesktop.Hal'", NULL);
libhal_ctx_set_device_added (hal_ctx, _hal_device_added);
libhal_ctx_set_device_removed (hal_ctx, _hal_device_removed);
libhal_ctx_set_device_property_modified (hal_ctx, _hal_property_modified);