[patch] Gnome-VFS and nautilus-cd-burner port to new HAL 0.5.0 and DBUS 0.3x API



Here are patches to update to the new APIs.  Ok to commit?

-- 
John (J5) Palmieri
Associate Software Engineer
Desktop Group
Red Hat, Inc.
Blog: http://martianrock.com
--- libgnomevfs/gnome-vfs-hal-mounts.c.orig	2005-02-26 17:51:58.000000000 -0500
+++ libgnomevfs/gnome-vfs-hal-mounts.c	2005-02-26 16:46:28.000000000 -0500
@@ -49,16 +49,9 @@
 
 typedef struct {
 	GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon;
-	HalStoragePolicy *hal_storage_policy;
+	LibHalStoragePolicy *hal_storage_policy;
 } GnomeVFSHalUserData;
 
-static void
-_hal_mainloop_integration (LibHalContext *ctx, 
-			   DBusConnection * dbus_connection)
-{
-        dbus_connection_setup_with_g_main (dbus_connection, NULL);
-}
-
 static void 
 _hal_device_added (LibHalContext *hal_ctx, 
 		   const char *udi)
@@ -66,16 +59,16 @@ _hal_device_added (LibHalContext *hal_ct
 	GnomeVFSHalUserData *hal_userdata;
 	GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon;
 	
-	hal_userdata = (GnomeVFSHalUserData *) hal_ctx_get_user_data (hal_ctx);
+	hal_userdata = (GnomeVFSHalUserData *) libhal_ctx_get_user_data (hal_ctx);
 	volume_monitor_daemon = hal_userdata->volume_monitor_daemon;
 
 	/* Handle optical discs without data since these are not handled
 	 * by GNOME VFS
 	 */
-	if (hal_device_get_property_bool (hal_ctx, udi, "volume.is_disc")) {
+	if (libhal_device_get_property_bool (hal_ctx, udi, "volume.is_disc", NULL)) {
 		const char *storage_udi;
 
-		storage_udi = hal_device_get_property_string (hal_ctx, udi, "block.storage_device");
+		storage_udi = libhal_device_get_property_string (hal_ctx, udi, "block.storage_device", NULL);
 		if (storage_udi != NULL) {
 			GnomeVFSDrive *drive;
 
@@ -97,7 +90,7 @@ _hal_device_removed (LibHalContext *hal_
 	GnomeVFSHalUserData *hal_userdata;
 	GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon;
 	
-	hal_userdata = (GnomeVFSHalUserData *) hal_ctx_get_user_data (hal_ctx);
+	hal_userdata = (GnomeVFSHalUserData *) libhal_ctx_get_user_data (hal_ctx);
 	volume_monitor_daemon = hal_userdata->volume_monitor_daemon;
 
 	drive = _gnome_vfs_volume_monitor_find_drive_by_hal_udi (
@@ -122,153 +115,93 @@ _hal_device_removed (LibHalContext *hal_
 	}
 }
 
-static void 
-_hal_device_new_capability (LibHalContext *hal_ctx, 
-			    const char *udi, 
-			    const char *capability)
-{
-	GnomeVFSHalUserData *hal_userdata;
-	GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon;
-	
-	hal_userdata = (GnomeVFSHalUserData *) hal_ctx_get_user_data (hal_ctx);
-	volume_monitor_daemon = hal_userdata->volume_monitor_daemon;
-
-	/* do nothing */
-}
-
-static void 
-_hal_device_lost_capability (LibHalContext *hal_ctx, 
-			     const char *udi,
-			     const char *capability)
-{
-	GnomeVFSHalUserData *hal_userdata;
-	GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon;
-	
-	hal_userdata = (GnomeVFSHalUserData *) hal_ctx_get_user_data (hal_ctx);
-	volume_monitor_daemon = hal_userdata->volume_monitor_daemon;
 
-	/* do nothing */
-}
 
-static void 
-_hal_device_property_modified (LibHalContext *hal_ctx, 
-			       const char *udi,
-			       const char *key,
-			       dbus_bool_t is_removed,
-			       dbus_bool_t is_added)
-{
-	GnomeVFSHalUserData *hal_userdata;
-	GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon;
-	
-	hal_userdata = (GnomeVFSHalUserData *) hal_ctx_get_user_data (hal_ctx);
-	volume_monitor_daemon = hal_userdata->volume_monitor_daemon;
-
-	/* do nothing */
-}
-
-static void 
-_hal_device_condition (LibHalContext *hal_ctx, 
-		       const char *udi,
-		       const char *condition_name,
-		       DBusMessage *message)
-{
-	GnomeVFSHalUserData *hal_userdata;
-	GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon;
-	
-	hal_userdata = (GnomeVFSHalUserData *) hal_ctx_get_user_data (hal_ctx);
-	volume_monitor_daemon = hal_userdata->volume_monitor_daemon;
-
-	/* do nothing */
-}
-
-static LibHalFunctions
-hal_functions = { _hal_mainloop_integration,
-		  _hal_device_added,
-		  _hal_device_removed,
-		  _hal_device_new_capability,
-		  _hal_device_lost_capability,
-		  _hal_device_property_modified,
-		  _hal_device_condition };
-
-static HalStoragePolicyIconPair icon_mapping[] = {
-	{HAL_STORAGE_ICON_DRIVE_REMOVABLE_DISK,           "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_REMOVABLE_DISK_IDE,       "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_REMOVABLE_DISK_SCSI,      "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_REMOVABLE_DISK_USB,       "gnome-dev-removable-usb"},
-	{HAL_STORAGE_ICON_DRIVE_REMOVABLE_DISK_IEEE1394,  "gnome-dev-removable-1394"},
-	{HAL_STORAGE_ICON_DRIVE_DISK,                     "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_DISK_IDE,                 "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_DISK_SCSI,                "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_DISK_USB,                 "gnome-dev-removable-usb"},
-	{HAL_STORAGE_ICON_DRIVE_DISK_IEEE1394,            "gnome-dev-removable-1394"},
-	{HAL_STORAGE_ICON_DRIVE_CDROM,                    "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_CDROM_IDE,                "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_CDROM_SCSI,               "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_CDROM_USB,                "gnome-dev-removable-usb"},
-	{HAL_STORAGE_ICON_DRIVE_CDROM_IEEE1394,           "gnome-dev-removable-1394"},
-	{HAL_STORAGE_ICON_DRIVE_FLOPPY,                   "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_FLOPPY_IDE,               "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_FLOPPY_SCSI,              "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_FLOPPY_USB,               "gnome-dev-removable-usb"},
-	{HAL_STORAGE_ICON_DRIVE_FLOPPY_IEEE1394,          "gnome-dev-removable-1394"},
-	{HAL_STORAGE_ICON_DRIVE_TAPE,                     "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_COMPACT_FLASH,            "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_MEMORY_STICK,             "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_SMART_MEDIA,              "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_SD_MMC,                   "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_CAMERA,                   "gnome-dev-removable"},
-	{HAL_STORAGE_ICON_DRIVE_PORTABLE_AUDIO_PLAYER,    "gnome-dev-removable"},
-
-	{HAL_STORAGE_ICON_VOLUME_REMOVABLE_DISK,          "gnome-dev-harddisk"},
-	{HAL_STORAGE_ICON_VOLUME_REMOVABLE_DISK_IDE,      "gnome-dev-harddisk"},
-	{HAL_STORAGE_ICON_VOLUME_REMOVABLE_DISK_SCSI,     "gnome-dev-harddisk"},
-	{HAL_STORAGE_ICON_VOLUME_REMOVABLE_DISK_USB,      "gnome-dev-harddisk-usb"},
-	{HAL_STORAGE_ICON_VOLUME_REMOVABLE_DISK_IEEE1394, "gnome-dev-harddisk-1394"},
-	{HAL_STORAGE_ICON_VOLUME_DISK,                    "gnome-dev-harddisk"},
-	{HAL_STORAGE_ICON_VOLUME_DISK_IDE,                "gnome-dev-harddisk"},
-	{HAL_STORAGE_ICON_VOLUME_DISK_SCSI,               "gnome-dev-harddisk"},
-	{HAL_STORAGE_ICON_VOLUME_DISK_USB,                "gnome-dev-harddisk-usb"},
-	{HAL_STORAGE_ICON_VOLUME_DISK_IEEE1394,           "gnome-dev-harddisk-1394"},
-	{HAL_STORAGE_ICON_VOLUME_CDROM,                   "gnome-dev-cdrom"},
-	{HAL_STORAGE_ICON_VOLUME_CDROM_IDE,               "gnome-dev-cdrom"},
-	{HAL_STORAGE_ICON_VOLUME_CDROM_SCSI,              "gnome-dev-cdrom"},
-	{HAL_STORAGE_ICON_VOLUME_CDROM_USB,               "gnome-dev-cdrom"},
-	{HAL_STORAGE_ICON_VOLUME_CDROM_IEEE1394,          "gnome-dev-cdrom"},
-	{HAL_STORAGE_ICON_VOLUME_FLOPPY,                  "gnome-dev-floppy"},
-	{HAL_STORAGE_ICON_VOLUME_FLOPPY_IDE,              "gnome-dev-floppy"},
-	{HAL_STORAGE_ICON_VOLUME_FLOPPY_SCSI,             "gnome-dev-floppy"},
-	{HAL_STORAGE_ICON_VOLUME_FLOPPY_USB,              "gnome-dev-floppy"},
-	{HAL_STORAGE_ICON_VOLUME_FLOPPY_IEEE1394,         "gnome-dev-floppy"},
-	{HAL_STORAGE_ICON_VOLUME_TAPE,                    "gnome-dev-harddisk"},
-	{HAL_STORAGE_ICON_VOLUME_COMPACT_FLASH,           "gnome-dev-media-cf"},
-	{HAL_STORAGE_ICON_VOLUME_MEMORY_STICK,            "gnome-dev-media-ms"},
-	{HAL_STORAGE_ICON_VOLUME_SMART_MEDIA,             "gnome-dev-media-sm"},
-	{HAL_STORAGE_ICON_VOLUME_SD_MMC,                  "gnome-dev-media-sdmmc"},
-	{HAL_STORAGE_ICON_VOLUME_CAMERA,                  "camera"},
-	{HAL_STORAGE_ICON_VOLUME_PORTABLE_AUDIO_PLAYER,   "gnome-dev-ipod"},
-
-	{HAL_STORAGE_ICON_DISC_CDROM,                     "gnome-dev-cdrom"},
-	{HAL_STORAGE_ICON_DISC_CDR,                       "gnome-dev-cdrom"},
-	{HAL_STORAGE_ICON_DISC_CDRW,                      "gnome-dev-cdrom"},
-	{HAL_STORAGE_ICON_DISC_DVDROM,                    "gnome-dev-dvd"},
-	{HAL_STORAGE_ICON_DISC_DVDRAM,                    "gnome-dev-dvd"},
-	{HAL_STORAGE_ICON_DISC_DVDR,                      "gnome-dev-dvd"},
-	{HAL_STORAGE_ICON_DISC_DVDRW,                     "gnome-dev-dvd"},
-	{HAL_STORAGE_ICON_DISC_DVDPLUSR,                  "gnome-dev-dvd"},
-	{HAL_STORAGE_ICON_DISC_DVDPLUSRW,                 "gnome-dev-dvd"},
+static LibHalStoragePolicyIconPair icon_mapping[] = {
+	{LIBHAL_STORAGE_ICON_DRIVE_REMOVABLE_DISK,           "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_REMOVABLE_DISK_IDE,       "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_REMOVABLE_DISK_SCSI,      "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_REMOVABLE_DISK_USB,       "gnome-dev-removable-usb"},
+	{LIBHAL_STORAGE_ICON_DRIVE_REMOVABLE_DISK_IEEE1394,  "gnome-dev-removable-1394"},
+	{LIBHAL_STORAGE_ICON_DRIVE_DISK,                     "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_DISK_IDE,                 "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_DISK_SCSI,                "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_DISK_USB,                 "gnome-dev-removable-usb"},
+	{LIBHAL_STORAGE_ICON_DRIVE_DISK_IEEE1394,            "gnome-dev-removable-1394"},
+	{LIBHAL_STORAGE_ICON_DRIVE_CDROM,                    "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_CDROM_IDE,                "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_CDROM_SCSI,               "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_CDROM_USB,                "gnome-dev-removable-usb"},
+	{LIBHAL_STORAGE_ICON_DRIVE_CDROM_IEEE1394,           "gnome-dev-removable-1394"},
+	{LIBHAL_STORAGE_ICON_DRIVE_FLOPPY,                   "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_FLOPPY_IDE,               "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_FLOPPY_SCSI,              "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_FLOPPY_USB,               "gnome-dev-removable-usb"},
+	{LIBHAL_STORAGE_ICON_DRIVE_FLOPPY_IEEE1394,          "gnome-dev-removable-1394"},
+	{LIBHAL_STORAGE_ICON_DRIVE_TAPE,                     "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_COMPACT_FLASH,            "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_MEMORY_STICK,             "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_SMART_MEDIA,              "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_SD_MMC,                   "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_CAMERA,                   "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_PORTABLE_AUDIO_PLAYER,    "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_ZIP,                      "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_JAZ,                      "gnome-dev-removable"},
+	{LIBHAL_STORAGE_ICON_DRIVE_FLASH_KEY,                "gnome-dev-removable"},
+
+	{LIBHAL_STORAGE_ICON_VOLUME_REMOVABLE_DISK,          "gnome-dev-harddisk"},
+	{LIBHAL_STORAGE_ICON_VOLUME_REMOVABLE_DISK_IDE,      "gnome-dev-harddisk"},
+	{LIBHAL_STORAGE_ICON_VOLUME_REMOVABLE_DISK_SCSI,     "gnome-dev-harddisk"},
+	{LIBHAL_STORAGE_ICON_VOLUME_REMOVABLE_DISK_USB,      "gnome-dev-harddisk-usb"},
+	{LIBHAL_STORAGE_ICON_VOLUME_REMOVABLE_DISK_IEEE1394, "gnome-dev-harddisk-1394"},
+	{LIBHAL_STORAGE_ICON_VOLUME_DISK,                    "gnome-dev-harddisk"},
+	{LIBHAL_STORAGE_ICON_VOLUME_DISK_IDE,                "gnome-dev-harddisk"},
+	{LIBHAL_STORAGE_ICON_VOLUME_DISK_SCSI,               "gnome-dev-harddisk"},
+	{LIBHAL_STORAGE_ICON_VOLUME_DISK_USB,                "gnome-dev-harddisk-usb"},
+	{LIBHAL_STORAGE_ICON_VOLUME_DISK_IEEE1394,           "gnome-dev-harddisk-1394"},
+	{LIBHAL_STORAGE_ICON_VOLUME_CDROM,                   "gnome-dev-cdrom"},
+	{LIBHAL_STORAGE_ICON_VOLUME_CDROM_IDE,               "gnome-dev-cdrom"},
+	{LIBHAL_STORAGE_ICON_VOLUME_CDROM_SCSI,              "gnome-dev-cdrom"},
+	{LIBHAL_STORAGE_ICON_VOLUME_CDROM_USB,               "gnome-dev-cdrom"},
+	{LIBHAL_STORAGE_ICON_VOLUME_CDROM_IEEE1394,          "gnome-dev-cdrom"},
+	{LIBHAL_STORAGE_ICON_VOLUME_FLOPPY,                  "gnome-dev-floppy"},
+	{LIBHAL_STORAGE_ICON_VOLUME_FLOPPY_IDE,              "gnome-dev-floppy"},
+	{LIBHAL_STORAGE_ICON_VOLUME_FLOPPY_SCSI,             "gnome-dev-floppy"},
+	{LIBHAL_STORAGE_ICON_VOLUME_FLOPPY_USB,              "gnome-dev-floppy"},
+	{LIBHAL_STORAGE_ICON_VOLUME_FLOPPY_IEEE1394,         "gnome-dev-floppy"},
+	{LIBHAL_STORAGE_ICON_VOLUME_TAPE,                    "gnome-dev-harddisk"},
+	{LIBHAL_STORAGE_ICON_VOLUME_COMPACT_FLASH,           "gnome-dev-media-cf"},
+	{LIBHAL_STORAGE_ICON_VOLUME_MEMORY_STICK,            "gnome-dev-media-ms"},
+	{LIBHAL_STORAGE_ICON_VOLUME_SMART_MEDIA,             "gnome-dev-media-sm"},
+	{LIBHAL_STORAGE_ICON_VOLUME_SD_MMC,                  "gnome-dev-media-sdmmc"},
+	{LIBHAL_STORAGE_ICON_VOLUME_CAMERA,                  "camera"},
+	{LIBHAL_STORAGE_ICON_VOLUME_PORTABLE_AUDIO_PLAYER,   "gnome-dev-ipod"},
+	{LIBHAL_STORAGE_ICON_VOLUME_ZIP,                     "gnome-dev-zipdisk"},
+	{LIBHAL_STORAGE_ICON_VOLUME_JAZ,                     "gnome-dev-jazdisk"},
+	{LIBHAL_STORAGE_ICON_VOLUME_FLASH_KEY,               "gnome-dev-harddisk"},
 
 /*
-	{HAL_STORAGE_ICON_DISC_CDROM,                     "gnome-dev-disc-cdrom"},
-	{HAL_STORAGE_ICON_DISC_CDR,                       "gnome-dev-disc-cdr"},
-	{HAL_STORAGE_ICON_DISC_CDRW,                      "gnome-dev-disc-cdrw"},
-	{HAL_STORAGE_ICON_DISC_DVDROM,                    "gnome-dev-disc-dvdrom"},
-	{HAL_STORAGE_ICON_DISC_DVDRAM,                    "gnome-dev-disc-dvdram"},
-	{HAL_STORAGE_ICON_DISC_DVDR,                      "gnome-dev-disc-dvdr"},
-	{HAL_STORAGE_ICON_DISC_DVDRW,                     "gnome-dev-disc-dvdrw"},
-	{HAL_STORAGE_ICON_DISC_DVDPLUSR,                  "gnome-dev-disc-dvdr-plus"},
-	{HAL_STORAGE_ICON_DISC_DVDPLUSRW,                 "gnome-dev-disc-dvdrw-plus"},
+	{LIBHAL_STORAGE_ICON_DISC_CDROM,                     "gnome-dev-cdrom"},
+	{LIBHAL_STORAGE_ICON_DISC_CDR,                       "gnome-dev-cdrom"},
+	{LIBHAL_STORAGE_ICON_DISC_CDRW,                      "gnome-dev-cdrom"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDROM,                    "gnome-dev-dvd"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDRAM,                    "gnome-dev-dvd"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDR,                      "gnome-dev-dvd"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDRW,                     "gnome-dev-dvd"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDPLUSR,                  "gnome-dev-dvd"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDPLUSRW,                 "gnome-dev-dvd"},
 */
 
+	{LIBHAL_STORAGE_ICON_DISC_CDROM,                     "gnome-dev-cdrom"},
+	{LIBHAL_STORAGE_ICON_DISC_CDR,                       "gnome-dev-disc-cdr"},
+	{LIBHAL_STORAGE_ICON_DISC_CDRW,                      "gnome-dev-disc-cdrw"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDROM,                    "gnome-dev-disc-dvdrom"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDRAM,                    "gnome-dev-disc-dvdram"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDR,                      "gnome-dev-disc-dvdr"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDRW,                     "gnome-dev-disc-dvdrw"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDPLUSR,                  "gnome-dev-disc-dvdr-plus"},
+	{LIBHAL_STORAGE_ICON_DISC_DVDPLUSRW,                 "gnome-dev-disc-dvdrw"}, /* missing -plus icon here! */
+
 	{0x00, NULL}
 };
 
@@ -276,26 +209,52 @@ static HalStoragePolicyIconPair icon_map
 gboolean
 _gnome_vfs_hal_mounts_init (GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon)
 {
+	DBusError error;
+	DBusConnection *dbus_connection;
 	GnomeVFSHalUserData *hal_userdata;
-	HalStoragePolicy *hal_storage_policy;
+	LibHalStoragePolicy *hal_storage_policy;
 
 	/* Initialise the connection to the hal daemon */
 	if ((volume_monitor_daemon->hal_ctx = 
-	     hal_initialize (&hal_functions, FALSE)) == NULL) {
-		g_warning ("hal_initialize failed\n");
+	     libhal_ctx_new ()) == NULL) {
+		g_warning ("libhal_ctx_new failed\n");
+		return FALSE;
+	}
+
+	dbus_error_init (&error);
+	dbus_connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
+	if (dbus_error_is_set (&error)) {
+		g_warning ("Error connecting to D-BUS system bus: %s\n",
+			   error.message);
+		dbus_error_free (&error);
+		return FALSE;
+	}	
+        dbus_connection_setup_with_g_main (dbus_connection, NULL);
+
+	libhal_ctx_set_dbus_connection (volume_monitor_daemon->hal_ctx, 
+					dbus_connection);
+
+	libhal_ctx_set_device_added (volume_monitor_daemon->hal_ctx,
+				     _hal_device_added);
+	libhal_ctx_set_device_removed (volume_monitor_daemon->hal_ctx,
+		  		       _hal_device_removed);
+	
+	if (!libhal_ctx_init (volume_monitor_daemon->hal_ctx, &error)) {
+		g_warning ("libhal_ctx_init failed: %s\n", error.message);
+		dbus_error_free (&error);
 		return FALSE;
 	}
 
 
 	/* Setup GNOME specific policy - right now this is only icons */
-	hal_storage_policy = hal_storage_policy_new ();
-	hal_storage_policy_set_icon_mapping (hal_storage_policy, icon_mapping);
+	hal_storage_policy = libhal_storage_policy_new ();
+	libhal_storage_policy_set_icon_mapping (hal_storage_policy, icon_mapping);
 
 	/* Tie some data with the libhal context */
 	hal_userdata = g_new0 (GnomeVFSHalUserData, 1);
 	hal_userdata->volume_monitor_daemon = volume_monitor_daemon;
 	hal_userdata->hal_storage_policy = hal_storage_policy;
-	hal_ctx_set_user_data (volume_monitor_daemon->hal_ctx,
+	libhal_ctx_set_user_data (volume_monitor_daemon->hal_ctx,
 			       hal_userdata);
 	return TRUE;
 }
@@ -304,13 +263,22 @@ void
 _gnome_vfs_hal_mounts_shutdown (GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon)
 {
 	GnomeVFSHalUserData *hal_userdata;
+	DBusError error;
+
+	hal_userdata = (GnomeVFSHalUserData *) libhal_ctx_get_user_data (volume_monitor_daemon->hal_ctx);
+	libhal_storage_policy_free (hal_userdata->hal_storage_policy);
 
-	hal_userdata = (GnomeVFSHalUserData *) hal_ctx_get_user_data (volume_monitor_daemon->hal_ctx);
-	hal_storage_policy_free (hal_userdata->hal_storage_policy);
+	dbus_error_init (&error);
+	if (!libhal_ctx_shutdown (volume_monitor_daemon->hal_ctx, &error)) {
+		g_warning ("hal_shutdown failed: %s\n", error.message);
+		dbus_error_free (&error);
+		return;
+	}
 
-	if (hal_shutdown (volume_monitor_daemon->hal_ctx) != 0) {
-		g_warning ("hal_shutdown failed\n");
+	if (!libhal_ctx_free (volume_monitor_daemon->hal_ctx)) {
+		g_warning ("hal_shutdown failed - unable to free hal context\n");
 	}
+
 }
 
 /**************************************************************************/
@@ -330,10 +298,10 @@ _gnome_vfs_hal_mounts_modify_drive (Gnom
 	char *drive_icon;
 	char *unique_drive_name;
 	LibHalContext *hal_ctx; 
-	HalDrive *hal_drive;
-	HalVolume *hal_volume;
+	LibHalDrive *hal_drive;
+	LibHalVolume *hal_volume;
 	GnomeVFSHalUserData *hal_userdata;
-	HalStoragePolicy *hal_storage_policy;
+	LibHalStoragePolicy *hal_storage_policy;
 	char *target_mount_point;
 
 	hal_drive = NULL;
@@ -342,7 +310,7 @@ _gnome_vfs_hal_mounts_modify_drive (Gnom
 	if ((hal_ctx = volume_monitor_daemon->hal_ctx) == NULL)
 		goto out;
 
-	hal_userdata = (GnomeVFSHalUserData *) hal_ctx_get_user_data (hal_ctx);
+	hal_userdata = (GnomeVFSHalUserData *) libhal_ctx_get_user_data (hal_ctx);
 	hal_storage_policy = hal_userdata->hal_storage_policy;
 
 	if (drive == NULL || drive->priv == NULL || drive->priv->device_path == NULL)
@@ -352,21 +320,21 @@ _gnome_vfs_hal_mounts_modify_drive (Gnom
 	 * /dev/sda1 etc, however we get the Drive object for the parent if
 	 * that is the case. This is a feature of libhal-storage.
 	 */
-	if ((hal_drive = hal_drive_from_device_file (hal_ctx, drive->priv->device_path)) == NULL) {
+	if ((hal_drive = libhal_drive_from_device_file (hal_ctx, drive->priv->device_path)) == NULL) {
 		g_warning ("%s: no hal drive for device=%s", __FUNCTION__, drive->priv->device_path);
 		goto out;
 	}
 
 	/* There may not be a volume object associated, so hal_volume may be NULL */
-	hal_volume = hal_volume_from_device_file (hal_ctx, drive->priv->device_path);
+	hal_volume = libhal_volume_from_device_file (hal_ctx, drive->priv->device_path);
 
 	/* For optical discs, we manually add/remove GnomeVFSVolume optical discs without 
 	 * data (e.g. blank and pure audio) since these don't appear in the mounted filesystems
 	 * file /etc/mtab
 	 */
 	if (hal_volume != NULL && 
-	    hal_drive_get_type (hal_drive) == HAL_DRIVE_TYPE_CDROM && 
-	    hal_volume_is_disc (hal_volume) && !hal_volume_disc_has_data (hal_volume)) {
+	    libhal_drive_get_type (hal_drive) == LIBHAL_DRIVE_TYPE_CDROM && 
+	    libhal_volume_is_disc (hal_volume) && !libhal_volume_disc_has_data (hal_volume)) {
 		GnomeVFSVolume *volume;
 		char *volume_name;
 		char *volume_icon;
@@ -377,35 +345,35 @@ _gnome_vfs_hal_mounts_modify_drive (Gnom
 			gnome_vfs_volume_unref (volume);
 		} else {
 			
-			volume_name = hal_volume_policy_compute_display_name (
+			volume_name = libhal_volume_policy_compute_display_name (
 				hal_drive, hal_volume, hal_storage_policy);
 
 			/* set icon name; try dedicated icon name first... */
-			if (hal_drive_get_dedicated_icon_volume (hal_drive) != NULL)
-				volume_icon = strdup (hal_drive_get_dedicated_icon_volume (hal_drive));
+			if (libhal_drive_get_dedicated_icon_volume (hal_drive) != NULL)
+				volume_icon = strdup (libhal_drive_get_dedicated_icon_volume (hal_drive));
 			else
-				volume_icon = hal_volume_policy_compute_icon_name (
+				volume_icon = libhal_volume_policy_compute_icon_name (
 					hal_drive, hal_volume, hal_storage_policy);
 
 			volume = g_object_new (GNOME_VFS_TYPE_VOLUME, NULL);
-			volume->priv->hal_udi = g_strdup (hal_volume_get_udi (hal_volume));
+			volume->priv->hal_udi = g_strdup (libhal_volume_get_udi (hal_volume));
 			volume->priv->volume_type = GNOME_VFS_VOLUME_TYPE_MOUNTPOINT;
 			
-			if (hal_volume_disc_is_blank (hal_volume)) {
+			if (libhal_volume_disc_is_blank (hal_volume)) {
 				/* Blank discs should open the burn:/// location */
-				volume->priv->device_path = g_strdup (hal_volume_get_device_file (hal_volume));
+				volume->priv->device_path = g_strdup (libhal_volume_get_device_file (hal_volume));
 				volume->priv->activation_uri = g_strdup ("burn:///");
-				volume->priv->unix_device = makedev (hal_volume_get_device_major (hal_volume), 
-								     hal_volume_get_device_minor (hal_volume));
-				volume->priv->filesystem_type = g_strdup (hal_volume_get_fstype (hal_volume));
-			} else if (hal_volume_disc_has_audio (hal_volume)) {
+				volume->priv->unix_device = makedev (libhal_volume_get_device_major (hal_volume), 
+								     libhal_volume_get_device_minor (hal_volume));
+				volume->priv->filesystem_type = g_strdup (libhal_volume_get_fstype (hal_volume));
+			} else if (libhal_volume_disc_has_audio (hal_volume)) {
 				/* Audio discs with data should open the cdda:///dev/cdrom location */
-				volume->priv->device_path = g_strdup (hal_volume_get_device_file (hal_volume));
+				volume->priv->device_path = g_strdup (libhal_volume_get_device_file (hal_volume));
 				volume->priv->activation_uri = g_strdup_printf (
-					"cdda://%s", hal_volume_get_device_file (hal_volume));
-				volume->priv->unix_device = makedev (hal_volume_get_device_major (hal_volume), 
-								     hal_volume_get_device_minor (hal_volume));
-				volume->priv->filesystem_type = g_strdup (hal_volume_get_fstype (hal_volume));
+					"cdda://%s", libhal_volume_get_device_file (hal_volume));
+				volume->priv->unix_device = makedev (libhal_volume_get_device_major (hal_volume), 
+								     libhal_volume_get_device_minor (hal_volume));
+				volume->priv->filesystem_type = g_strdup (libhal_volume_get_fstype (hal_volume));
 			}
 			
 			volume->priv->is_read_only = TRUE;
@@ -419,6 +387,7 @@ _gnome_vfs_hal_mounts_modify_drive (Gnom
 			volume->priv->is_user_visible = TRUE;
 			
 			volume->priv->drive = drive;
+
 			_gnome_vfs_drive_add_mounted_volume (drive, volume);
 			
 			_gnome_vfs_volume_monitor_mounted (GNOME_VFS_VOLUME_MONITOR (volume_monitor_daemon), volume);
@@ -427,7 +396,7 @@ _gnome_vfs_hal_mounts_modify_drive (Gnom
 			free (volume_name);
 			free (volume_icon);
 		}
-	} else if (hal_volume == NULL && hal_drive_get_type (hal_drive) == HAL_DRIVE_TYPE_CDROM) {
+	} else if (hal_volume == NULL && libhal_drive_get_type (hal_drive) == LIBHAL_DRIVE_TYPE_CDROM) {
 		GnomeVFSVolume *volume;
 
 		/* Remove GnomeVFSVolume with same device file */
@@ -444,10 +413,10 @@ _gnome_vfs_hal_mounts_modify_drive (Gnom
 		goto out;
 
 	/* set whether we need to eject */
-	drive->priv->must_eject_at_unmount = hal_drive_requires_eject (hal_drive);
+	drive->priv->must_eject_at_unmount = libhal_drive_requires_eject (hal_drive);
 
 	/* set display name */
-	drive_name = hal_drive_policy_compute_display_name (hal_drive, hal_volume, hal_storage_policy);
+	drive_name = libhal_drive_policy_compute_display_name (hal_drive, hal_volume, hal_storage_policy);
 	unique_drive_name = _gnome_vfs_volume_monitor_uniquify_drive_name (
 		GNOME_VFS_VOLUME_MONITOR (volume_monitor_daemon), drive_name);
 	if (drive->priv->display_name != NULL)
@@ -456,10 +425,10 @@ _gnome_vfs_hal_mounts_modify_drive (Gnom
 	free (drive_name);
 
 	/* set icon name; try dedicated icon name first... */
-	if (hal_drive_get_dedicated_icon_drive (hal_drive) != NULL)
-		drive_icon = strdup (hal_drive_get_dedicated_icon_drive (hal_drive));
+	if (libhal_drive_get_dedicated_icon_drive (hal_drive) != NULL)
+		drive_icon = strdup (libhal_drive_get_dedicated_icon_drive (hal_drive));
 	else
-		drive_icon = hal_drive_policy_compute_icon_name (hal_drive, hal_volume, hal_storage_policy);
+		drive_icon = libhal_drive_policy_compute_icon_name (hal_drive, hal_volume, hal_storage_policy);
 	if (drive->priv->icon != NULL)
 		g_free (drive->priv->icon);
 	drive->priv->icon = g_strdup (drive_icon);
@@ -469,7 +438,7 @@ _gnome_vfs_hal_mounts_modify_drive (Gnom
 	target_mount_point = NULL;
 	if (hal_volume != NULL) {
 		const char *str;
-		str = hal_volume_get_mount_point (hal_volume);
+		str = libhal_volume_get_mount_point (hal_volume);
 		if (str != NULL)
 			target_mount_point = g_strdup (str);
 	}
@@ -479,18 +448,18 @@ _gnome_vfs_hal_mounts_modify_drive (Gnom
 		target_mount_point = gnome_vfs_get_local_path_from_uri (drive->priv->activation_uri);
 
 	/* if we don't use removable media and the volume shouldn't be visible, then hide the drive */
-	if(!hal_drive_uses_removable_media (hal_drive) && 
-	   !hal_volume_policy_should_be_visible (hal_drive, hal_volume, hal_storage_policy, target_mount_point))
+	if(!libhal_drive_uses_removable_media (hal_drive) && 
+	   !libhal_volume_policy_should_be_visible (hal_drive, hal_volume, hal_storage_policy, target_mount_point))
 		drive->priv->is_user_visible = FALSE;
 
 	g_free (target_mount_point);
 
 	/* set hal udi */
-	drive->priv->hal_udi = g_strdup (hal_drive_get_udi (hal_drive));
+	drive->priv->hal_udi = g_strdup (libhal_drive_get_udi (hal_drive));
 
 out:
-	hal_volume_free (hal_volume);
-	hal_drive_free (hal_drive);
+	libhal_volume_free (hal_volume);
+	libhal_drive_free (hal_drive);
 }
 
 void 
@@ -501,10 +470,10 @@ _gnome_vfs_hal_mounts_modify_volume (Gno
 	char *volume_icon;
 	char *unique_volume_name;
 	LibHalContext *hal_ctx; 
-	HalDrive *hal_drive;
-	HalVolume *hal_volume;
+	LibHalDrive *hal_drive;
+	LibHalVolume *hal_volume;
 	GnomeVFSHalUserData *hal_userdata;
-	HalStoragePolicy *hal_storage_policy;
+	LibHalStoragePolicy *hal_storage_policy;
 	char *target_mount_point;
 
 	hal_volume = NULL;
@@ -515,7 +484,7 @@ _gnome_vfs_hal_mounts_modify_volume (Gno
 	if (volume == NULL || volume->priv == NULL || volume->priv->device_path == NULL)
 		goto out;
 
-	hal_userdata = (GnomeVFSHalUserData *) hal_ctx_get_user_data (hal_ctx);
+	hal_userdata = (GnomeVFSHalUserData *) libhal_ctx_get_user_data (hal_ctx);
 	hal_storage_policy = hal_userdata->hal_storage_policy;
 
 	/* Now, modify the drive with the hal stuff, unless we've already done so */
@@ -526,17 +495,17 @@ _gnome_vfs_hal_mounts_modify_volume (Gno
 	 * /dev/sda1 etc, however we get the Drive object for the parent if
 	 * that is the case. This is a feature of libhal-storage.
 	 */
-	if ((hal_drive = hal_drive_from_device_file (hal_ctx, volume->priv->device_path)) == NULL) {
+	if ((hal_drive = libhal_drive_from_device_file (hal_ctx, volume->priv->device_path)) == NULL) {
 		g_warning ("%s: no hal drive for device=%s", __FUNCTION__, volume->priv->device_path);
 		goto out;
 	}
-	if ((hal_volume = hal_volume_from_device_file (hal_ctx, volume->priv->device_path)) == NULL) {
+	if ((hal_volume = libhal_volume_from_device_file (hal_ctx, volume->priv->device_path)) == NULL) {
 		g_warning ("%s: no hal volume for device=%s", __FUNCTION__, volume->priv->device_path);
 		goto out;
 	}
 
 	/* set display name */
-	volume_name = hal_volume_policy_compute_display_name (hal_drive, hal_volume, hal_storage_policy);
+	volume_name = libhal_volume_policy_compute_display_name (hal_drive, hal_volume, hal_storage_policy);
 	unique_volume_name = _gnome_vfs_volume_monitor_uniquify_volume_name (
 		GNOME_VFS_VOLUME_MONITOR (volume_monitor_daemon), volume_name);
 	if (volume->priv->display_name != NULL)
@@ -545,10 +514,10 @@ _gnome_vfs_hal_mounts_modify_volume (Gno
 	free (volume_name);
 
 	/* set icon name; try dedicated icon name first... */
-	if (hal_drive_get_dedicated_icon_volume (hal_drive) != NULL)
-		volume_icon = strdup (hal_drive_get_dedicated_icon_volume (hal_drive));
+	if (libhal_drive_get_dedicated_icon_volume (hal_drive) != NULL)
+		volume_icon = strdup (libhal_drive_get_dedicated_icon_volume (hal_drive));
 	else
-		volume_icon = hal_volume_policy_compute_icon_name (hal_drive, hal_volume, hal_storage_policy);
+		volume_icon = libhal_volume_policy_compute_icon_name (hal_drive, hal_volume, hal_storage_policy);
 	if (volume->priv->icon != NULL)
 		g_free (volume->priv->icon);
 	volume->priv->icon = g_strdup (volume_icon);
@@ -558,7 +527,7 @@ _gnome_vfs_hal_mounts_modify_volume (Gno
 	target_mount_point = NULL;
 	{
 		const char *str;
-		str = hal_volume_get_mount_point (hal_volume);
+		str = libhal_volume_get_mount_point (hal_volume);
 		if (str != NULL)
 			target_mount_point = g_strdup (str);
 	}
@@ -569,16 +538,16 @@ _gnome_vfs_hal_mounts_modify_volume (Gno
 
 	/* set whether it's visible on the desktop */
 	volume->priv->is_user_visible = 
-		hal_volume_policy_should_be_visible (hal_drive, hal_volume, hal_storage_policy, target_mount_point) &&
-		(hal_drive_is_hotpluggable (hal_drive) || hal_drive_uses_removable_media (hal_drive));
+		libhal_volume_policy_should_be_visible (hal_drive, hal_volume, hal_storage_policy, target_mount_point) &&
+		(libhal_drive_is_hotpluggable (hal_drive) || libhal_drive_uses_removable_media (hal_drive));
 
 	g_free (target_mount_point);
 
 	/* set hal udi */
-	volume->priv->hal_udi = g_strdup (hal_volume_get_udi (hal_volume));
+	volume->priv->hal_udi = g_strdup (libhal_volume_get_udi (hal_volume));
 out:
-	hal_drive_free (hal_drive);
-	hal_volume_free (hal_volume);
+	libhal_drive_free (hal_drive);
+	libhal_volume_free (hal_volume);
 }
 
 #endif /* USE_HAL */
Index: nautilus-burn-drive.c
===================================================================
RCS file: /cvs/gnome/nautilus-cd-burner/nautilus-burn-drive.c,v
retrieving revision 1.3
diff -u -r1.3 nautilus-burn-drive.c
--- nautilus-burn-drive.c	10 Feb 2005 21:56:17 -0000	1.3
+++ nautilus-burn-drive.c	23 Feb 2005 18:37:00 -0000
@@ -88,18 +88,38 @@
 get_hal_context (void)
 {
 	static LibHalContext *ctx = NULL;
-	LibHalFunctions       hal_functions = {
-		NULL, /* mainloop integration */
-		NULL, /* device_added */
-		NULL, /* device_removed */
-		NULL, /* device_new_capability */
-		NULL, /* device_lost_capability */
-		NULL, /* property_modified */
-		NULL, /* device_condition */
-	};
+	DBusError error;
+	DBusConnection *dbus_conn;
+
+	if (ctx == NULL) {
+		ctx = libhal_ctx_new ();
+		if (ctx == NULL) {
+			g_warning ("Could not create a HAL context\n");
+		} else { 
+			dbus_error_init (&error);
+			dbus_conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
+
+			if (dbus_error_is_set (&error)) {
+				g_warning ("Could not connect to system bus: %s\n", error.message);
+				dbus_error_free (&error);
+				return NULL;
+			}
+
+			libhal_ctx_set_dbus_connection (ctx, dbus_conn);
+
+			if (!libhal_ctx_init (ctx, &error)) {
+				g_warning ("Could not initalize "
+					   "the HAL context: %s\n",
+					   error.message);
+
+				if (dbus_error_is_set (&error))
+					dbus_error_free (&error);
 
-	if (ctx == NULL)
-		ctx = hal_initialize (&hal_functions, FALSE);
+				libhal_ctx_free (ctx);
+				ctx = NULL;
+			}
+		}
+	}
 
 	return ctx;
 }
@@ -423,43 +443,66 @@
 		int                   num_devices;
 		NautilusBurnMediaType type;
 		char                 *hal_type;
+		DBusError error;
 		
 		ctx = get_hal_context ();
+
+		dbus_error_init (&error);
 		if (ctx != NULL) {
-			device_names = hal_manager_find_device_string_match (ctx, 
-									     "info.parent",
-									     drive->priv->udi,
-									     &num_devices);
-			if (num_devices == 0) {
+			device_names = libhal_manager_find_device_string_match (ctx, 
+										"info.parent",
+										drive->priv->udi,
+										&num_devices,
+										&error);
+
+			if (dbus_error_is_set (&error)) {
+				g_warning ("%s\n", error.message);
+				dbus_error_free (&error);
 				return NAUTILUS_BURN_MEDIA_TYPE_ERROR;
 			}
 
+			if (num_devices == 0)
+				return NAUTILUS_BURN_MEDIA_TYPE_ERROR;
+			
+
 			/* just look at the first child */
-			if (hal_device_get_property_bool (ctx, 
-							  device_names [0],
-							  "volume.is_mounted")) {
+			if (libhal_device_get_property_bool (ctx, 
+							     device_names [0],
+							     "volume.is_mounted",
+							     NULL)) {
 				type = NAUTILUS_BURN_MEDIA_TYPE_BUSY;
-			} else {		    
+			} else {
+			
 				if (is_rewritable)
-					*is_rewritable = hal_device_get_property_bool (ctx, 
-										       device_names [0],
-										       "volume.disc.is_rewritable");
+					*is_rewritable = libhal_device_get_property_bool (ctx, 
+									 		  device_names [0],
+											  "volume.disc.is_rewritable",
+											  NULL);
+
 				if (is_blank)
-					*is_blank = hal_device_get_property_bool (ctx, 
-										  device_names [0],
-										  "volume.disc.is_blank");
+					*is_blank = libhal_device_get_property_bool (ctx, 
+										     device_names [0],
+										     "volume.disc.is_blank",
+										     NULL);
+
 				if (has_data)
-					*has_data = hal_device_get_property_bool (ctx, 
-										  device_names [0],
-										  "volume.disc.has_data");
+					*has_data = libhal_device_get_property_bool (ctx, 
+										     device_names [0],
+										     "volume.disc.has_data",
+										     NULL);
+
 				if (has_audio)
-					*has_audio = hal_device_get_property_bool (ctx, 
-										  device_names [0],
-										  "volume.disc.has_audio");
+					*has_audio = libhal_device_get_property_bool (ctx, 
+										      device_names [0],
+										      "volume.disc.has_audio",
+										      NULL);
+
 				type = NAUTILUS_BURN_MEDIA_TYPE_BUSY;
-				hal_type = hal_device_get_property_string (ctx, 
-									   device_names [0],
-									   "volume.disc.type");
+				hal_type = libhal_device_get_property_string (ctx, 
+									      device_names [0],
+									      "volume.disc.type",
+									      NULL);
+
 				if (hal_type == NULL || strcmp (hal_type, "unknown") == 0) {
 					type = NAUTILUS_BURN_MEDIA_TYPE_UNKNOWN;
 				} else if (strcmp (hal_type, "cd_rom") == 0) {
@@ -485,10 +528,10 @@
 				}
 				
 				if (hal_type != NULL)
-					hal_free_string (hal_type);
+					libhal_free_string (hal_type);
 			}
 
-			hal_free_string_array (device_names);
+			libhal_free_string_array (device_names);
 
 			return type;
 		}
@@ -789,7 +832,7 @@
 
 #ifdef USE_HAL
 
-#define GET_BOOL_PROP(x) (hal_device_property_exists (ctx, device_names [i], x) && hal_device_get_property_bool (ctx, device_names [i], x))
+#define GET_BOOL_PROP(x) (libhal_device_property_exists (ctx, device_names [i], x, NULL) && libhal_device_get_property_bool (ctx, device_names [i], x, NULL))
 
 static GList *
 hal_scan (gboolean recorder_only)
@@ -805,8 +848,10 @@
 		return NULL;
 	}
 
-	device_names = hal_find_device_by_capability (ctx,
-						      "storage.cdrom", &num_devices);
+	device_names = libhal_find_device_by_capability (ctx,
+						         "storage.cdrom", 
+							 &num_devices,
+							 NULL);
 
 	if (device_names == NULL)
 		return NULL;
@@ -827,47 +872,61 @@
 		if (GET_BOOL_PROP ("storage.cdrom.cdrw")) {
 			drive->type |= NAUTILUS_BURN_DRIVE_TYPE_CDRW_RECORDER;
 		}
+
 		if (GET_BOOL_PROP ("storage.cdrom.dvd")) {
 			drive->type |= NAUTILUS_BURN_DRIVE_TYPE_DVD_DRIVE;
 
 			if (GET_BOOL_PROP ("storage.cdrom.dvdram")) {
 				drive->type |= NAUTILUS_BURN_DRIVE_TYPE_DVD_RAM_RECORDER;
 			}
+
 			if (GET_BOOL_PROP ("storage.cdrom.dvdr")) {
 				drive->type |= NAUTILUS_BURN_DRIVE_TYPE_DVD_RW_RECORDER;
 			}
+
 			if (GET_BOOL_PROP ("storage.cdrom.dvd")) {
 				drive->type |= NAUTILUS_BURN_DRIVE_TYPE_DVD_DRIVE;
 			}
+
 			if (GET_BOOL_PROP ("storage.cdrom.dvdplusr")) {
 				drive->type |= NAUTILUS_BURN_DRIVE_TYPE_DVD_PLUS_R_RECORDER;
 			}
+
 			if (GET_BOOL_PROP ("storage.cdrom.dvdplusrw")) {
 				drive->type |= NAUTILUS_BURN_DRIVE_TYPE_DVD_PLUS_RW_RECORDER;
 			}
+
 		}
 
-		drive->device = hal_device_get_property_string (ctx,
-								device_names [i], "block.device");
+		drive->device = libhal_device_get_property_string (ctx,
+								   device_names [i], 
+								   "block.device",
+								   NULL);
+
 		drive->cdrecord_id = g_strdup (drive->device);
 
-		string = hal_device_get_property_string (ctx,
-							 device_names [i], "storage.model");
+		string = libhal_device_get_property_string (ctx,
+							    device_names [i], 
+							    "storage.model",
+							    NULL);
+
 		if (string != NULL) {
 			drive->display_name = string;
 		} else {
 			drive->display_name = g_strdup_printf ("Unnamed Drive (%s)", drive->device);
 		}
 
-		drive->max_speed_read = hal_device_get_property_int
-			(ctx, device_names [i], "storage.cdrom.read_speed")
+		drive->max_speed_read = libhal_device_get_property_int
+			(ctx, device_names [i], "storage.cdrom.read_speed", NULL)
 			/ CD_ROM_SPEED;
 
-		if (hal_device_property_exists (ctx, device_names [i], "storage.cdrom.write_speed")) {
-			drive->max_speed_write = hal_device_get_property_int
+		if (libhal_device_property_exists (ctx, device_names [i], "storage.cdrom.write_speed", NULL)) {
+			drive->max_speed_write = libhal_device_get_property_int
 				(ctx, device_names [i],
-				 "storage.cdrom.write_speed")
+				 "storage.cdrom.write_speed",
+				 NULL)
 				/ CD_ROM_SPEED;
+
 		}
 
 		add_whitelist (drive);
@@ -881,7 +940,7 @@
 		drive->priv->udi = g_strdup (device_names [i]);
 	}
 
-	hal_free_string_array (device_names);
+	libhal_free_string_array (device_names);
 
 	drives = g_list_reverse (drives);
 
@@ -1848,13 +1907,20 @@
 	if (drive->priv->udi != NULL) {
 		LibHalContext *ctx;
 		char *dbus_reason;
+		DBusError error;
 		
+		dbus_error_init (&error);
 		ctx = get_hal_context ();
 		if (ctx != NULL) {
-			res = hal_device_lock (ctx, 
+			res = libhal_device_lock (ctx, 
 					       drive->priv->udi,
 					       reason,
-					       &dbus_reason);
+					       &dbus_reason,
+					       &error);
+
+			if (dbus_error_is_set (&error))
+				dbus_error_free (&error);
+				
 			if (dbus_reason != NULL && 
 			    reason_for_failure != NULL)
 				*reason_for_failure = g_strdup (dbus_reason);
@@ -1885,11 +1951,17 @@
 #ifdef USE_HAL
 	if (drive->priv->udi != NULL) {
 		LibHalContext *ctx;
+		DBusError error;
 
+		dbus_error_init (&error);
 		ctx = get_hal_context ();
 		if (ctx != NULL) {
-			res = hal_device_unlock (ctx, 
-						 drive->priv->udi);
+			res = libhal_device_unlock (ctx, 
+						    drive->priv->udi,
+						    &error);
+
+			if (dbus_error_is_set (&error))
+				dbus_error_free (&error);
 		}
 	}
 #endif


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