patches/gvfs-07-init-dbus-error.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 17534 6cb0de4499a9
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17534
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
     1
--- gvfs-1.4.3/monitor/hal/hal-device.c.orig	2009-11-27 22:13:48.000000000 +0800
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
     2
+++ gvfs-1.4.3/monitor/hal/hal-device.c	2010-01-11 16:13:35.423555462 +0800
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
     3
@@ -44,8 +44,11 @@
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
     4
 static void
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
     5
 hal_device_finalize (HalDevice *device)
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
     6
 {
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
     7
+
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
     8
+  DBusError error;
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
     9
+  dbus_error_init(&error);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    10
   libhal_device_remove_property_watch (device->priv->hal_ctx,
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    11
-      device->priv->udi, NULL);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    12
+      device->priv->udi, &error);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    13
   
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    14
   if (device->priv->properties != NULL)
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    15
     libhal_free_property_set (device->priv->properties);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    16
@@ -53,6 +56,8 @@
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    17
   
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    18
   if (G_OBJECT_CLASS (hal_device_parent_class)->finalize)
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    19
     (* G_OBJECT_CLASS (hal_device_parent_class)->finalize) (G_OBJECT (device));
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    20
+  
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    21
+  dbus_error_free (&error);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    22
 }
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    23
 
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    24
 static void
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    25
@@ -226,12 +231,18 @@
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    26
 {
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    27
   HalDevice *device;
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    28
 
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    29
-  libhal_device_add_property_watch (hal_ctx, udi, NULL);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    30
+  DBusError error;
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    31
+  dbus_error_init (&error);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    32
+
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    33
+  libhal_device_add_property_watch (hal_ctx, udi, &error);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    34
   
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    35
   device = HAL_DEVICE (g_object_new (HAL_TYPE_DEVICE, NULL));
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    36
   device->priv->udi = g_strdup (udi);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    37
   device->priv->hal_ctx = hal_ctx;
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    38
   device->priv->properties = libhal_device_get_all_properties (hal_ctx, udi, NULL);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    39
+
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    40
+  dbus_error_free (&error);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    41
+
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    42
   return device;
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    43
 }
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    44
 
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    45
@@ -241,13 +252,19 @@
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    46
                                         LibHalPropertySet *properties)
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    47
 {
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    48
   HalDevice *device;
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    49
-  
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    50
-  libhal_device_add_property_watch (hal_ctx, udi, NULL);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    51
+
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    52
+  DBusError error;
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    53
+  dbus_error_init (&error);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    54
+
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    55
+  libhal_device_add_property_watch (hal_ctx, udi, &error);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    56
   
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    57
   device = HAL_DEVICE (g_object_new (HAL_TYPE_DEVICE, NULL));
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    58
   device->priv->udi = g_strdup (udi);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    59
   device->priv->hal_ctx = hal_ctx;
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    60
   device->priv->properties = properties;
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    61
+
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    62
+  dbus_error_free (&error);
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    63
+
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    64
   return device;
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    65
 }
6cb0de4499a9 bump to 1.5.2
jerrytan
parents:
diff changeset
    66