Index: rb-audiocd-source.c
===================================================================
--- rb-audiocd-source.c	(revision 5875)
+++ rb-audiocd-source.c	(working copy)
@@ -39,22 +39,17 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include <gst/gst.h>
-/*#include <totem-disc.h>*/
 
 #include "rb-plugin.h"
 #include "rhythmdb.h"
 #include "eel-gconf-extensions.h"
+#include "rb-shell.h"
 #include "rb-audiocd-source.h"
 #include "rb-util.h"
 #include "rb-debug.h"
 #include "rb-dialog.h"
 #include "rb-glade-helpers.h"
 
-#ifdef HAVE_HAL
-#include <libhal.h>
-#include <dbus/dbus.h>
-#endif
-
 #ifdef HAVE_MUSICBRAINZ
 #include "sj-metadata-musicbrainz.h"
 #include "sj-structures.h"
@@ -536,6 +531,14 @@
 		return;
 	}
 
+	GtkWidget *label;
+	RBShell *shell;
+	label = gtk_label_new ("FOOOOOOOOOOOOOOOOOOOOOOOOB");
+	gtk_widget_show (label);
+  	g_object_get (source, "shell", &shell, NULL);
+	rb_shell_add_widget (shell, label, RB_SHELL_UI_LOCATION_MAIN_TOP);
+	g_object_unref (shell);
+
 	db = get_db_for_source (source);
 
 	g_value_init (&true_value, G_TYPE_BOOLEAN);
@@ -720,178 +723,27 @@
 	g_object_unref (db);
 }
 
-#if  0
 gboolean
 rb_audiocd_is_volume_audiocd (GVolume *volume)
 {
-	char *device_path;
-
-	device_path = g_volume_get_identifier (volume, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
-	if (device_path != NULL) {
-		gboolean result;
-		TotemDiscMediaType media_type;
-		GError *error = NULL;
-
-		/* should we do any kind of checking before we make this call? */
-		media_type = totem_cd_detect_type (device_path, &error);
-		if (error != NULL) {
-			rb_debug ("error detecting if volume is an audio CD: %s", error->message);
-			g_error_free (error);
-			result = FALSE;
-		} else if (media_type == MEDIA_TYPE_CDDA) {
-			rb_debug ("totem-disc says this is an audio CD");
-			result = TRUE;
-		} else {
-			rb_debug ("totem-disc says this is not an audio CD");
-			result = FALSE;
-		}
-
-		g_free (device_path);
-		return result;
-	} else {
-		rb_debug ("couldn't get device path");
-		return FALSE;
-	}
-}
-#endif
-
-
-#ifdef HAVE_HAL
-
-/* copied this stuff from the generic player plugin,
- * so it should probably go somewhere common.
- */
-
-static void
-free_dbus_error (const char *what, DBusError *error)
-{
-	if (dbus_error_is_set (error)) {
-		rb_debug ("%s: dbus error: %s", what, error->message);
-		dbus_error_free (error);
-	}
-}
-
-static LibHalContext *
-get_hal_context (void)
-{
-	LibHalContext *ctx = NULL;
-	DBusConnection *conn = NULL;
-	DBusError error;
-	gboolean result = FALSE;
-
-	dbus_error_init (&error);
-	ctx = libhal_ctx_new ();
-	if (ctx == NULL)
-		return NULL;
-
-	conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
-	if (conn != NULL && !dbus_error_is_set (&error)) {
-		libhal_ctx_set_dbus_connection (ctx, conn);
-		if (libhal_ctx_init (ctx, &error))
-			result = TRUE;
-	}
-
-	if (dbus_error_is_set (&error)) {
-		free_dbus_error ("setting up hal context", &error);
-		result = FALSE;
-	}
-
-	if (!result) {
-		libhal_ctx_free (ctx);
-		ctx = NULL;
-	}
-	return ctx;
-}
-
-static void
-cleanup_hal_context (LibHalContext *ctx)
-{
-	DBusError error;
-	if (ctx == NULL)
-		return;
-
-	dbus_error_init (&error);
-	libhal_ctx_shutdown (ctx, &error);
-	libhal_ctx_free (ctx);
-	free_dbus_error ("cleaning up hal context", &error);
-}
-
-#endif
-
-gboolean
-rb_audiocd_is_volume_audiocd (GVolume *volume)
-{
 	GMount *mount;
-#ifdef HAVE_HAL
-	LibHalContext *ctx;
-	char *udi;
-	char *device_path;
 
-	/* get device path for debug purposes */
-	device_path = g_volume_get_identifier (volume, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
-	if (device_path == NULL) {
-		device_path = g_strdup ("unknown device");
-	}
-
-	/* look at HAL properties to see if it's an audio CD */
-	udi = g_volume_get_identifier (volume, G_VOLUME_IDENTIFIER_KIND_HAL_UDI);
-	if (udi != NULL) {
-		ctx = get_hal_context ();
-		if (ctx != NULL) {
-			gboolean result = FALSE;
-			DBusError error;
-			dbus_error_init (&error);
-
-			/* check if it's a disc at all */
-			if (libhal_device_query_capability (ctx, udi, "volume.disc", &error) &&
-			    !dbus_error_is_set (&error)) {
-				/* check it's a CD with audio; maybe check it's not blank? */
-				dbus_bool_t is_audio;
-
-				is_audio = libhal_device_get_property_bool (ctx, udi, "volume.disc.has_audio", &error);
-				if (dbus_error_is_set (&error)) {
-					free_dbus_error ("checking if disc has audio", &error);
-					is_audio = FALSE;
-				}
-
-				if (is_audio) {
-					rb_debug ("disc in %s is an audio CD", device_path);
-					result = TRUE;
-				} else {
-					rb_debug ("disc %s is not an audio CD", device_path);
-				}
-				
-			} else if (dbus_error_is_set (&error)) {
-				free_dbus_error ("checking volume type", &error);
-			} else {
-				rb_debug ("volume in %s is not a disc", device_path);
-			}
-
-			cleanup_hal_context (ctx);
-			return result;
-		}
-	}
-	g_free (device_path);
-	rb_debug ("HAL couldn't tell us if this is an audio CD or not");
-#endif
-
 	/* if it's mounted, we can check the mount root URI scheme */
 	mount = g_volume_get_mount (volume);
 	if (mount != NULL) {
-		GFile *mount_root;
-		char *uri_scheme;
 		gboolean result = FALSE;
+		char **types;
+		guint i;
 
-		mount_root = g_mount_get_root (mount);
-		if (mount_root != NULL) {
-			uri_scheme = g_file_get_uri_scheme (mount_root);
-			rb_debug ("URI scheme of mounted volume is %s", uri_scheme);
-			result = (strcmp (uri_scheme, "cdda") == 0);
-
-			g_free (uri_scheme);
-			g_object_unref (mount_root);
+		types = g_mount_guess_content_type_sync (mount, FALSE, NULL, NULL);
+		for (i = 0; types[i] != NULL; i++) {
+			if (g_str_equal (types[i], "x-content/audio-cdda") != FALSE) {
+				result = TRUE;
+				break;
+			}
 		}
 
+		g_strfreev (types);
 		g_object_unref (mount);
 		return result;
 	}
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 5875)
+++ Makefile.am	(working copy)
@@ -10,7 +10,6 @@
 
 libaudiocd_la_LIBADD = \
 	$(top_builddir)/corelib/librhythmbox-core.la \
-	$(HAL_LIBS)                  \
 	$(TOTEM_PLPARSER_LIBS)       \
 	$(LIBNAUTILUS_BURN_LIBS)
 
@@ -41,7 +40,6 @@
 	-DSHARE_DIR=\"$(pkgdatadir)\"                   \
 	-DDATADIR=\""$(datadir)"\"			\
 	$(TOTEM_PLPARSER_CFLAGS)			\
-	$(HAL_CFLAGS)					\
 	$(RHYTHMBOX_CFLAGS)				\
 	$(LIBNAUTILUS_BURN_CFLAGS)			\
 	-D_XOPEN_SOURCE -D_BSD_SOURCE
