? memcheck.7247
? data/playlists.xml
? sources/rb-generic-player-source.c
? sources/rb-generic-player-source.h
Index: configure.ac
===================================================================
RCS file: /cvs/gnome/rhythmbox/configure.ac,v
retrieving revision 1.198
diff -u -u -r1.198 configure.ac
--- configure.ac	5 Jan 2006 08:19:10 -0000	1.198
+++ configure.ac	5 Jan 2006 10:06:49 -0000
@@ -59,6 +59,32 @@
    AC_MSG_ERROR([totem playlist parsing library not found or too old])
 fi   
 
+AC_ARG_WITH(hal,
+	      AC_HELP_STRING([--without-hal],
+			     [Disable HAL support]))
+if test "x$with_hal" != "xno"; then
+  PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal05=yes, enable_hal05=no)
+  if test x$enable_hal05 != xyes; then
+     PKG_CHECK_MODULES(HAL, hal >= 0.2.92 hal < 0.5, enable_hal02=yes, enable_hal02=no)
+  fi
+  if test x$enable_hal05 == xyes || test x$enable_hal02 == xyes; then
+      enable_hal=yes
+      if test x$enable_hal05 == xyes; then
+         AC_DEFINE(HAVE_HAL_0_5, 1, [Define if you have HAL 0.5 or later])
+      else
+         AC_DEFINE(HAVE_HAL_0_2, 1, [Define if you have HAL 0.2 or later])
+      fi
+  	  AC_SUBST(HAL_CFLAGS)
+  	  AC_SUBST(HAL_LIBS)
+  else
+    if test "x$with_hal" = "xyes"; then
+	  AC_MSG_ERROR([HAL support explicitly requested but HAL couldn't be found])
+    fi
+  fi
+fi
+
+
+
 dnl iPod support
 
 AC_ARG_WITH(ipod,
@@ -72,29 +98,13 @@
 	  AC_MSG_ERROR([iPod explicitly requested but libgpod couldn't be found])
 	fi
 	if test "x$have_libgpod" = "xyes"; then
-	  PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal05=yes, enable_hal05=no)
-	  if test x$enable_hal05 != xyes; then
-	     PKG_CHECK_MODULES(HAL, hal >= 0.2.92 hal < 0.5, enable_hal02=yes, enable_hal02=no)
-	  fi
-	  if test x$enable_hal05 == xyes || test x$enable_hal02 == xyes; then
-  	    enable_hal=yes
-	  else
-	    enable_hal=no
-	  fi
           if test "x$with_hal" = xyes && test "x$enable_hal" = xno; then
 	     AC_MSG_ERROR([iPod explicitly requested but HAL not found or too old])	   
 	  fi
           if test "x$enable_hal" = xyes; then
 	     AC_DEFINE(WITH_IPOD_SUPPORT, 1, [Define if iPod support is enabled])
 	     use_ipod=yes
-	     if test x$enable_hal05 == xyes; then
-	        AC_DEFINE(HAVE_HAL_0_5, 1, [Define if you have HAL 0.5 or later])
-	     else
-	        AC_DEFINE(HAVE_HAL_0_2, 1, [Define if you have HAL 0.2 or later])
-	     fi
 	  fi
-	  AC_SUBST(HAL_CFLAGS)
-	  AC_SUBST(HAL_LIBS)
 	  AC_SUBST(IPOD_CFLAGS)
 	  AC_SUBST(IPOD_LIBS)
 	fi
@@ -715,6 +725,11 @@
 	AC_MSG_NOTICE([** Bonobo control/activation enabled])
 else
 	AC_MSG_NOTICE([   Bonobo control/activation disabled])
+fi
+if test x"$enable_hal" = xyes; then
+	AC_MSG_NOTICE([** HAL support enabled])
+else
+	AC_MSG_NOTICE([   HAL support disabled])
 fi
 if test x"$enable_dbus" = xyes; then
 	AC_MSG_NOTICE([** D-BUS control/activation enabled])
Index: rhythmdb/rhythmdb.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb.c,v
retrieving revision 1.152
diff -u -u -r1.152 rhythmdb.c
--- rhythmdb/rhythmdb.c	19 Dec 2005 10:17:12 -0000	1.152
+++ rhythmdb/rhythmdb.c	5 Jan 2006 10:06:51 -0000
@@ -130,6 +130,7 @@
 {
 	RhythmDB *db;
 	char *uri;
+	RhythmDBEntryType type;
 } RhythmDBAddThreadData;
 
 typedef struct
@@ -140,6 +141,7 @@
 		RHYTHMDB_ACTION_SYNC
 	} type;
 	char *uri;
+ 	RhythmDBEntryType entry_type;
 } RhythmDBAction;
 
 typedef struct
@@ -157,6 +159,7 @@
 	} type;
 	char *uri;
 	char *real_uri; /* Target of a symlink, if any */
+	RhythmDBEntryType entry_type;
 
 	GError *error;
 	RhythmDB *db;
@@ -193,7 +196,7 @@
 static gpointer add_thread_main (RhythmDBAddThreadData *data);
 static gpointer action_thread_main (RhythmDB *db);
 static gpointer query_thread_main (RhythmDBQueryThreadData *data);
-static void queue_stat_uri (const char *uri, RhythmDB *db);
+static void queue_stat_uri (const char *uri, RhythmDB *db, RhythmDBEntryType type);
 static void rhythmdb_entry_set_internal (RhythmDB *db, RhythmDBEntry *entry, gboolean notify_if_inserted, guint propid, const GValue *value);
 static void rhythmdb_entry_set_mount_point (RhythmDB *db, 
  					    RhythmDBEntry *entry, 
@@ -836,7 +839,7 @@
 			const gchar *uri;
 			uri = rhythmdb_entry_get_string (entry, 
 							 RHYTHMDB_PROP_LOCATION);
-			queue_stat_uri (uri, db);
+			queue_stat_uri (uri, db, -1);
 		}
 		g_assert (entry->inserted == FALSE);
 		entry->inserted = TRUE;
@@ -1377,6 +1380,10 @@
 	entry = rhythmdb_entry_lookup_by_location (db, event->real_uri);
 	if (entry) {
 		time_t mtime = (time_t) entry->mtime;
+
+		if ((event->entry_type != -1) && (entry->type != event->entry_type))
+			g_warning ("attempt to use same location in multiple entry types");
+
 		if (event->error) {
 			if (!is_ghost_entry (entry)) {
 				rhythmdb_entry_set_visibility (db, entry, FALSE);
@@ -1443,6 +1450,7 @@
 		action = g_new0 (RhythmDBAction, 1);
 		action->type = RHYTHMDB_ACTION_LOAD;
 		action->uri = g_strdup (event->real_uri);
+		action->entry_type = event->entry_type;
 		rb_debug ("queuing a RHYTHMDB_ACTION_LOAD: %s", action->uri);
 		g_async_queue_push (db->priv->action_queue, action);
 	}
@@ -1507,8 +1515,9 @@
 
 	entry = rhythmdb_entry_lookup_by_location (db, event->real_uri);
 	if (!entry) {
-
-		entry = rhythmdb_entry_new (db, RHYTHMDB_ENTRY_TYPE_SONG, event->real_uri);
+		if (event->entry_type == -1)
+			event->entry_type = RHYTHMDB_ENTRY_TYPE_SONG;
+		entry = rhythmdb_entry_new (db, event->entry_type, event->real_uri);
 		if (entry == NULL) {
 			rb_debug ("entry already exists");
 			return TRUE;
@@ -1534,6 +1543,9 @@
 		g_value_unset (&value);
 	}
 
+	if ((event->entry_type != -1) && (entry->type != event->entry_type))
+		g_warning ("attempt to use same location in multiple entry types");
+
 	set_props_from_metadata (db, entry, event->vfsinfo, event->metadata);
 
 	/* we've seen this entry */
@@ -1582,6 +1594,7 @@
 	action = g_new0 (RhythmDBAction, 1);
 	action->type = RHYTHMDB_ACTION_LOAD;
 	action->uri = g_strdup (event->uri);
+	action->entry_type = -1;
 	g_async_queue_push (db->priv->action_queue, action);
 }
 
@@ -1738,7 +1751,7 @@
 }
 
 static void
-queue_stat_uri (const char *uri, RhythmDB *db)
+queue_stat_uri (const char *uri, RhythmDB *db, RhythmDBEntryType type)
 {
 	RhythmDBAction *action;
 
@@ -1748,16 +1761,24 @@
 	action = g_new0 (RhythmDBAction, 1);
 	action->type = RHYTHMDB_ACTION_STAT;
 	action->uri = g_strdup (uri);
+	action->entry_type = type;
 	g_async_queue_push (db->priv->action_queue, action);
 }
 
+static void
+queue_stat_uri_tad (const char *uri, RhythmDBAddThreadData *data)
+{
+	queue_stat_uri (uri, data->db, data->type);
+}
+
+
 static gpointer
 add_thread_main (RhythmDBAddThreadData *data)
 {
 	RhythmDBEvent *result;
 
-	rb_uri_handle_recursively (data->uri, (GFunc) queue_stat_uri,
-				   &data->db->priv->exiting, data->db);
+	rb_uri_handle_recursively (data->uri, (GFunc) queue_stat_uri_tad,
+				   &data->db->priv->exiting, data);
 
 	rb_debug ("exiting");
 	result = g_new0 (RhythmDBEvent, 1);
@@ -1947,6 +1968,7 @@
 			result = g_new0 (RhythmDBEvent, 1);
 			result->db = db;
 			result->type = RHYTHMDB_EVENT_STAT;
+			result->entry_type = action->entry_type;
 
 			rb_debug ("executing RHYTHMDB_ACTION_STAT for \"%s\"", action->uri);
 
@@ -1958,6 +1980,7 @@
 			result = g_new0 (RhythmDBEvent, 1);
 			result->db = db;
 			result->type = RHYTHMDB_EVENT_METADATA_LOAD;
+			result->entry_type = action->entry_type;
 
 			rb_debug ("executing RHYTHMDB_ACTION_LOAD for \"%s\"", action->uri);
 
@@ -2039,16 +2062,23 @@
 void
 rhythmdb_add_uri (RhythmDB *db, const char *uri)
 {
+	rhythmdb_add_uri_with_type (db, uri, RHYTHMDB_ENTRY_TYPE_SONG);
+}
+
+void
+rhythmdb_add_uri_with_type (RhythmDB *db, const char *uri, RhythmDBEntryType type)
+{
 	char  *realuri = rb_uri_resolve_symlink (uri);
 
 	if (rb_uri_is_directory (realuri)) {
 		RhythmDBAddThreadData *data = g_new0 (RhythmDBAddThreadData, 1);
 		data->db = db;
 		data->uri = realuri;
+		data->type = type;
 
 		rhythmdb_thread_create (db, (GThreadFunc) add_thread_main, data);
 	} else {
-		queue_stat_uri (realuri, db);
+		queue_stat_uri (realuri, db, type);
 		g_free (realuri);
 	}
 }
@@ -3669,8 +3699,6 @@
 {
 	GValue old_val = {0, };
 	gboolean old_visible;
-
-	g_assert (entry->type == RHYTHMDB_ENTRY_TYPE_SONG);
 
 	g_value_init (&old_val, G_TYPE_BOOLEAN);
 	
Index: rhythmdb/rhythmdb.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb.h,v
retrieving revision 1.63
diff -u -u -r1.63 rhythmdb.h
--- rhythmdb/rhythmdb.h	27 Dec 2005 06:38:28 -0000	1.63
+++ rhythmdb/rhythmdb.h	5 Jan 2006 10:06:52 -0000
@@ -476,6 +476,7 @@
 RhythmDBEntry *	rhythmdb_entry_new	(RhythmDB *db, RhythmDBEntryType type, const char *uri);
 
 void		rhythmdb_add_uri	(RhythmDB *db, const char *uri);
+void		rhythmdb_add_uri_with_type	(RhythmDB *db, const char *uri, RhythmDBEntryType type);
 
 void		rhythmdb_entry_set	(RhythmDB *db, RhythmDBEntry *entry,
 					 guint propid, const GValue *value);
