diff -u -p -u -r1.14 rhythmdb.defs
--- bindings/python/rhythmdb.defs	25 May 2006 23:09:41 -0000	1.14
+++ bindings/python/rhythmdb.defs	1 Jun 2006 05:53:49 -0000
@@ -462,6 +462,7 @@
   (return-type "none")
   (parameters
     '("RhythmDBQueryResults*" "results")
+    '("gboolean*" "cancel")
     '("RhythmDBQuery*" "query")
   )
 )
@@ -472,6 +473,7 @@
   (return-type "none")
   (parameters
     '("RhythmDBQueryResults*" "results")
+    '("gboolean*" "cancel")
     '("RhythmDBQuery*" "query")
   )
 )
@@ -537,21 +539,15 @@
 )
 
 (define-method entry_ref
-  (of-object "RhythmDB")
+  (of-object "RhythmDBEntry")
   (c-name "rhythmdb_entry_ref")
-  (return-type "none")
-  (parameters
-    '("RhythmDBEntry*" "entry")
-  )
+  (return-type "RhythmDBEntry*")
 )
 
 (define-method entry_unref
-  (of-object "RhythmDB")
+  (of-object "RhythmDBEntry")
   (c-name "rhythmdb_entry_unref")
   (return-type "none")
-  (parameters
-    '("RhythmDBEntry*" "entry")
-  )
 )
 
 (define-function rhythmdb_entry_register_type
Index: bindings/python/rhythmdb.override
===================================================================
RCS file: /cvs/gnome/rhythmbox/bindings/python/rhythmdb.override,v
retrieving revision 1.10
diff -u -p -u -r1.10 rhythmdb.override
--- bindings/python/rhythmdb.override	16 May 2006 12:42:45 -0000	1.10
+++ bindings/python/rhythmdb.override	1 Jun 2006 05:53:50 -0000
@@ -348,7 +348,6 @@ _wrap_rhythmdb_query_model_set_sort_orde
 	static char *kwlist[] = {"func", "reverse", NULL};
 	int reverse = 0;
 	PyRhythmDBQueryModelSortData *data;
-	RhythmDBQueryModel *query_model;
 
 	data = g_new0 (PyRhythmDBQueryModelSortData, 1);
 
@@ -368,7 +367,7 @@ _wrap_rhythmdb_query_model_set_sort_orde
 	Py_INCREF (data->func);
 	Py_INCREF (data->data);
 
-	rhythmdb_query_model_set_sort_order (RHYTHMDB (self->obj),
+	rhythmdb_query_model_set_sort_order (RHYTHMDB_QUERY_MODEL (self->obj),
 					     (GCompareDataFunc) _rhythmdb_query_model_sort_func,
 					     data, (GDestroyNotify) _rhythmdb_query_model_sort_data_free,
 					     (reverse != 0));
diff -u -p -u -r1.46 rb-podcast-manager.c
--- podcast/rb-podcast-manager.c	30 May 2006 05:04:18 -0000	1.46
+++ podcast/rb-podcast-manager.c	1 Jun 2006 05:53:51 -0000
@@ -486,10 +486,11 @@ rb_podcast_manager_sync_head_cb (gpointe
 void
 rb_podcast_manager_update_feeds (RBPodcastManager *pd)
 {
-	GtkTreeModel* query_model = GTK_TREE_MODEL (rhythmdb_query_model_new_empty(pd->priv->db));	
+	GtkTreeModel* query_model = GTK_TREE_MODEL (rhythmdb_query_model_new_empty (pd->priv->db));	
 
 	rhythmdb_do_full_query (pd->priv->db, 
 				RHYTHMDB_QUERY_RESULTS (query_model),
+				NULL,
                                 RHYTHMDB_QUERY_PROP_EQUALS,
                                 RHYTHMDB_PROP_TYPE, RHYTHMDB_ENTRY_TYPE_PODCAST_FEED,
                                 RHYTHMDB_QUERY_END);
@@ -1256,6 +1257,7 @@ rb_podcast_manager_db_entry_deleted_cb (
 
 		rhythmdb_do_full_query (pd->priv->db, 
 					RHYTHMDB_QUERY_RESULTS (query_model),
+					NULL,
                 	                RHYTHMDB_QUERY_PROP_EQUALS,
                         	        RHYTHMDB_PROP_TYPE, RHYTHMDB_ENTRY_TYPE_PODCAST_POST,
                 	                RHYTHMDB_QUERY_PROP_LIKE,
diff -u -p -u -r1.44 rhythmdb-property-model.c
--- rhythmdb/rhythmdb-property-model.c	13 May 2006 14:00:37 -0000	1.44
+++ rhythmdb/rhythmdb-property-model.c	1 Jun 2006 05:53:52 -0000
@@ -903,7 +903,7 @@ query_model_cb (GtkTreeModel *query_mode
  	g_string_append (data->reply, uri);
  	g_string_append (data->reply, "\r\n");
 	
- 	rhythmdb_entry_unref (data->db, entry);
+ 	rhythmdb_entry_unref (entry);
  	return FALSE;
 }
 
diff -u -p -u -r1.127 rhythmdb-query-model.c
--- rhythmdb/rhythmdb-query-model.c	20 May 2006 03:56:37 -0000	1.127
+++ rhythmdb/rhythmdb-query-model.c	1 Jun 2006 05:53:54 -0000
@@ -573,7 +573,7 @@ rhythmdb_query_model_constructor (GType 
 static void
 _unref_entry (RhythmDBEntry *entry, gpointer stuff, RhythmDB *db)
 {
-	rhythmdb_entry_unref (db, entry);
+	rhythmdb_entry_unref (entry);
 }
 
 static void
@@ -911,7 +911,7 @@ idle_process_update (struct RhythmDBQuer
 				rhythmdb_query_model_do_insert (update->model, entry, -1);
 			}
 			
-			rhythmdb_entry_unref (update->model->priv->db, entry);
+			rhythmdb_entry_unref (entry);
 		}
 		g_ptr_array_free (update->entrydata.entries, TRUE);
 		break;
@@ -920,7 +920,7 @@ idle_process_update (struct RhythmDBQuer
 	{
 		rb_debug ("inserting row at index %d", update->entrydata.data.index);
 		rhythmdb_query_model_do_insert (update->model, update->entrydata.data.entry, update->entrydata.data.index);
-		rhythmdb_entry_unref (update->model->priv->db, update->entrydata.data.entry);
+		rhythmdb_entry_unref (update->entrydata.data.entry);
 		break;
 	}
 	case RHYTHMDB_QUERY_MODEL_UPDATE_QUERY_COMPLETE:
@@ -960,7 +960,7 @@ rhythmdb_query_model_add_entry (RhythmDB
 	update->model = model;
 
 	g_object_ref (G_OBJECT (model));
-	rhythmdb_entry_ref (model->priv->db, entry);
+	rhythmdb_entry_ref (entry);
 	rhythmdb_query_model_process_update (update);
 }
 
@@ -980,7 +980,7 @@ static void
 rhythmdb_query_model_insert_into_main_list (RhythmDBQueryModel *model, RhythmDBEntry *entry, gint index)
 {
 	GSequencePtr ptr;
-	rhythmdb_entry_ref (model->priv->db, entry);
+	rhythmdb_entry_ref (entry);
 
 	if (model->priv->sort_func) {
 		GCompareDataFunc sort_func;
@@ -1022,7 +1022,7 @@ rhythmdb_query_model_insert_into_limited
 {
 	GSequencePtr ptr;
 
-	rhythmdb_entry_ref (model->priv->db, entry);
+	rhythmdb_entry_ref (entry);
 
 	if (model->priv->sort_func) {
 		GCompareDataFunc sort_func;
@@ -1072,7 +1072,7 @@ rhythmdb_query_model_remove_from_main_li
 	g_sequence_remove (ptr);
 	g_assert (g_hash_table_remove (model->priv->reverse_map, entry));
 	
-	rhythmdb_entry_unref (model->priv->db, entry);
+	rhythmdb_entry_unref (entry);
 }
 
 static void
@@ -1082,7 +1082,7 @@ rhythmdb_query_model_remove_from_limited
 
 	g_sequence_remove (ptr);
 	g_hash_table_remove (model->priv->limited_reverse_map, entry);
-	rhythmdb_entry_unref (model->priv->db, entry);
+	rhythmdb_entry_unref (entry);
 }
 
 static void
@@ -1597,7 +1597,7 @@ rhythmdb_query_model_drag_data_received 
 				GSequencePtr old_ptr = g_hash_table_lookup (model->priv->reverse_map,
 									    entry);
 
-				rhythmdb_entry_ref (model->priv->db, entry);
+				rhythmdb_entry_ref (entry);
 
 				/* the entry already exists it is either a reorder drag and drop
 				   (or a drag and drop from another application), so we delete
@@ -1691,7 +1691,7 @@ rhythmdb_query_model_add_results (Rhythm
 	g_object_ref (G_OBJECT (model));
 
 	for (i = 0; i < update->entrydata.entries->len; i++)
-		rhythmdb_entry_ref (model->priv->db, g_ptr_array_index (update->entrydata.entries, i));
+		rhythmdb_entry_ref (g_ptr_array_index (update->entrydata.entries, i));
 
 	rhythmdb_query_model_process_update (update);
 }
@@ -2578,6 +2578,7 @@ rhythmdb_query_model_reapply_query_cb (R
 	rhythmdb_query_model_reapply_query (model, FALSE);
 	rhythmdb_do_full_query_async_parsed (model->priv->db,
 					     RHYTHMDB_QUERY_RESULTS (model),
+					     NULL,
 					     model->priv->query);
 	return TRUE;
 }
diff -u -p -u -r1.108 rhythmdb-tree.c
--- rhythmdb/rhythmdb-tree.c	28 May 2006 22:44:52 -0000	1.108
+++ rhythmdb/rhythmdb-tree.c	1 Jun 2006 05:53:55 -0000
@@ -369,11 +369,11 @@ rhythmdb_tree_parser_end_element (struct
 				if (ctx->entry->last_seen > entry->last_seen)
 					entry->last_seen = ctx->entry->last_seen;
 				
-				rhythmdb_entry_unref (RHYTHMDB (ctx->db), ctx->entry);
+				rhythmdb_entry_unref (ctx->entry);
 			}
 		} else {
 			rb_debug ("found entry without location");
-			rhythmdb_entry_unref (RHYTHMDB (ctx->db), ctx->entry);
+			rhythmdb_entry_unref (ctx->entry);
 		}
 		ctx->state = RHYTHMDB_TREE_PARSER_STATE_RHYTHMDB;
 		break;
@@ -1226,7 +1226,7 @@ rhythmdb_tree_entry_delete (RhythmDB *ad
 	g_assert (g_hash_table_lookup (db->priv->entries, entry->location) != NULL);
 
 	g_hash_table_remove (db->priv->entries, entry->location);
-	rhythmdb_entry_unref (adb, entry);
+	rhythmdb_entry_unref (entry);
 }
 
 typedef struct {
@@ -1243,7 +1243,7 @@ remove_one_song (gchar *uri, RhythmDBEnt
 	if (entry->type == ctxt->type) {
 		rhythmdb_emit_entry_deleted (ctxt->db, entry);
 		remove_entry_from_album (RHYTHMDB_TREE (ctxt->db), entry); 
-		rhythmdb_entry_unref (ctxt->db, entry);
+		rhythmdb_entry_unref (entry);
 		return TRUE;
 	}
 	return FALSE;
@@ -1509,7 +1509,7 @@ static void
 do_conjunction (RhythmDBEntry *entry, gpointer unused,
 		struct RhythmDBTreeTraversalData *data)
 {
-	if (G_UNLIKELY (*data->cancel))
+	if (G_UNLIKELY (data->cancel && *data->cancel))
 		return;
 	/* Finally, we actually evaluate the query! */
 	if (evaluate_conjunctive_subquery (data->db, data->query, 0, data->query->len,
@@ -1522,7 +1522,7 @@ static void
 conjunctive_query_songs (const char *name, RhythmDBTreeProperty *album,
 			 struct RhythmDBTreeTraversalData *data)
 {
-	if (G_UNLIKELY (*data->cancel))
+	if (G_UNLIKELY (data->cancel && *data->cancel))
 		return;
 	g_hash_table_foreach (album->children, (GHFunc) do_conjunction, data);
 }
@@ -1546,7 +1546,7 @@ conjunctive_query_albums (const char *na
 	guint i;
 	int album_query_idx = -1;
 
-	if (G_UNLIKELY (*data->cancel))
+	if (G_UNLIKELY (data->cancel && *data->cancel))
 		return;
 
 	for (i = 0; i < data->query->len; i++) {
@@ -1588,7 +1588,7 @@ conjunctive_query_artists (const char *n
 	guint i;
 	int artist_query_idx = -1;
 
-	if (G_UNLIKELY (*data->cancel))
+	if (G_UNLIKELY (data->cancel && *data->cancel))
 		return;
 
 	for (i = 0; i < data->query->len; i++) {
@@ -1629,7 +1629,7 @@ conjunctive_query_genre (RhythmDBTree *d
 	int genre_query_idx = -1;
 	guint i;
 
-	if (G_UNLIKELY (*data->cancel))
+	if (G_UNLIKELY (data->cancel && *data->cancel))
 		return;
 	
 	for (i = 0; i < data->query->len; i++) {
@@ -1783,7 +1783,7 @@ do_query_recurse (RhythmDBTree *db, GPtr
 		data->entries = NULL;
 
 	for (tem = conjunctions; tem; tem = tem->next) {
-		if (G_UNLIKELY (*cancel))
+		if (G_UNLIKELY (cancel && *cancel))
 			break;
 		conjunctive_query (db, tem->data, func, data, cancel);
 		g_ptr_array_free (tem->data, TRUE);
diff -u -p -u -r1.226 rhythmdb.c
--- rhythmdb/rhythmdb.c	28 May 2006 22:44:52 -0000	1.226
+++ rhythmdb/rhythmdb.c	1 Jun 2006 05:53:57 -0000
@@ -62,7 +62,7 @@ typedef struct
 	GPtrArray *query;
 	guint propid;
 	RhythmDBQueryResults *results;
-	gboolean cancel;
+	gboolean *cancel;
 } RhythmDBQueryThreadData;
 
 typedef struct
@@ -770,14 +770,14 @@ rhythmdb_emit_entry_signals_idle (Rhythm
 	for (l = added_entries; l; l = g_list_next (l)) {
 		RhythmDBEntry *entry = (RhythmDBEntry *)l->data;
 		g_signal_emit (G_OBJECT (db), rhythmdb_signals[ENTRY_ADDED], 0, entry);
-		rhythmdb_entry_unref (db, entry);
+		rhythmdb_entry_unref (entry);
 	}
 
 	/* emit deleted entries */
 	for (l = deleted_entries; l; l = g_list_next (l)) {
 		RhythmDBEntry *entry = (RhythmDBEntry *)l->data;
 		g_signal_emit (G_OBJECT (db), rhythmdb_signals[ENTRY_DELETED], 0, entry);
-		rhythmdb_entry_unref (db, entry);
+		rhythmdb_entry_unref (entry);
 	}
 
 	g_list_free (added_entries);
@@ -808,7 +808,7 @@ process_added_entries_cb (RhythmDBEntry 
 	g_assert ((entry->flags & RHYTHMDB_ENTRY_INSERTED) == 0);
 	entry->flags |= RHYTHMDB_ENTRY_INSERTED;
 	
-	rhythmdb_entry_ref (db, entry);
+	rhythmdb_entry_ref (entry);
 	db->priv->added_entries_to_emit = g_list_prepend (db->priv->added_entries_to_emit, entry);
 	return TRUE;
 }
@@ -1069,14 +1069,15 @@ rhythmdb_entry_example_new (RhythmDB *db
  *
  * Increase the reference count of the entry.
  **/
-void
-rhythmdb_entry_ref (RhythmDB *db, RhythmDBEntry *entry)
+RhythmDBEntry*
+rhythmdb_entry_ref (RhythmDBEntry *entry)
 {
 	g_atomic_int_inc (&entry->refcount);
+	return entry;
 }
 
 static void
-rhythmdb_entry_finalize (RhythmDB *db, RhythmDBEntry *entry)
+rhythmdb_entry_finalize (RhythmDBEntry *entry)
 {
 	RhythmDBEntryType type;
 
@@ -1104,10 +1105,10 @@ rhythmdb_entry_finalize (RhythmDB *db, R
  * no references left.
  **/
 void
-rhythmdb_entry_unref (RhythmDB *db, RhythmDBEntry *entry)
+rhythmdb_entry_unref (RhythmDBEntry *entry)
 {
 	if (g_atomic_int_dec_and_test (&entry->refcount))
-		rhythmdb_entry_finalize (db, entry);
+		rhythmdb_entry_finalize (entry);
 }
 
 /**
@@ -2703,7 +2704,7 @@ rhythmdb_entry_delete (RhythmDB *db, Rhy
 	
 	klass->impl_entry_delete (db, entry);
 
-	rhythmdb_entry_ref (db, entry);
+	rhythmdb_entry_ref (entry);
 	g_mutex_lock (db->priv->change_mutex);
 	g_hash_table_insert (db->priv->deleted_entries, entry, g_thread_self ());
 	g_mutex_unlock (db->priv->change_mutex);
@@ -2927,7 +2928,7 @@ rhythmdb_query_internal (RhythmDBQueryTh
 
 	klass->impl_do_full_query (data->db, data->query,
 				   data->results,
-				   &data->cancel);
+				   data->cancel);
 
 	rb_debug ("completed");
 	rhythmdb_query_results_query_complete (data->results);
@@ -2961,6 +2962,7 @@ query_thread_main (RhythmDBQueryThreadDa
 void
 rhythmdb_do_full_query_async_parsed (RhythmDB *db, 
 				     RhythmDBQueryResults *results,
+				     gboolean *cancel,
 				     GPtrArray *query)
 {
 	RhythmDBQueryThreadData *data;
@@ -2969,7 +2971,7 @@ rhythmdb_do_full_query_async_parsed (Rhy
 	data->db = db;
 	data->query = rhythmdb_query_copy (query);
 	data->results = results;
-	data->cancel = FALSE;
+	data->cancel = cancel;
 
 	rhythmdb_read_enter (db);
 
@@ -2982,16 +2984,17 @@ rhythmdb_do_full_query_async_parsed (Rhy
 void
 rhythmdb_do_full_query_async (RhythmDB *db,
 			      RhythmDBQueryResults *results,
+			      gboolean *cancel,
 			      ...)
 {
 	GPtrArray *query;
 	va_list args;
 
-	va_start (args, results);
+	va_start (args, cancel);
 
 	query = rhythmdb_query_parse_valist (db, args);
 
-	rhythmdb_do_full_query_async_parsed (db, results, query);
+	rhythmdb_do_full_query_async_parsed (db, results, cancel, query);
 
 	rhythmdb_query_free (query);
 
@@ -3001,6 +3004,7 @@ rhythmdb_do_full_query_async (RhythmDB *
 static void
 rhythmdb_do_full_query_internal (RhythmDB *db,
 				 RhythmDBQueryResults *results,
+				 gboolean *cancel,
 				 GPtrArray *query)
 {
 	RhythmDBQueryThreadData *data;
@@ -3009,7 +3013,7 @@ rhythmdb_do_full_query_internal (RhythmD
 	data->db = db;
 	data->query = rhythmdb_query_copy (query);
 	data->results = results;
-	data->cancel = FALSE;
+	data->cancel = cancel;
 
 	rhythmdb_read_enter (db);
 
@@ -3023,27 +3027,27 @@ rhythmdb_do_full_query_internal (RhythmD
 void
 rhythmdb_do_full_query_parsed (RhythmDB *db,
 			       RhythmDBQueryResults *results,
+			       gboolean *cancel,
 			       GPtrArray *query)
 {
-	rhythmdb_do_full_query_internal (db, results, query);
+	rhythmdb_do_full_query_internal (db, results, cancel, query);
 }
 
 void
 rhythmdb_do_full_query (RhythmDB *db, 
 			RhythmDBQueryResults *results,
+			gboolean *cancel,
 			...)
 {
 	GPtrArray *query;
 	va_list args;
 
-	va_start (args, results);
-
+	va_start (args, cancel);
 	query = rhythmdb_query_parse_valist (db, args);
 
-	rhythmdb_do_full_query_internal (db, results, query);
+	rhythmdb_do_full_query_internal (db, results, cancel, query);
 
 	rhythmdb_query_free (query);
-	
 	va_end (args);
 }
 
diff -u -p -u -r1.86 rhythmdb.h
--- rhythmdb/rhythmdb.h	25 May 2006 23:09:42 -0000	1.86
+++ rhythmdb/rhythmdb.h	1 Jun 2006 05:53:58 -0000
@@ -361,17 +361,21 @@ rhythmdb_do_full_query (db,
  */
 void		rhythmdb_do_full_query			(RhythmDB *db,
 							 RhythmDBQueryResults *results,
+							 gboolean *cancel,
 							 ...);
 void		rhythmdb_do_full_query_parsed		(RhythmDB *db,
 							 RhythmDBQueryResults *results,
+							 gboolean *cancel,
 							 GPtrArray *query);
 
 void		rhythmdb_do_full_query_async		(RhythmDB *db,
 							 RhythmDBQueryResults *results,
+							 gboolean *cancel,
 							 ...);
 
 void		rhythmdb_do_full_query_async_parsed	(RhythmDB *db,
 							 RhythmDBQueryResults *results,
+							 gboolean *cancel,
 							 GPtrArray *query);
 
 void		rhythmdb_entry_sync_mirrored		(RhythmDB *db, RhythmDBEntry *entry, guint propid);
@@ -416,8 +420,8 @@ RhythmDBEntryType rhythmdb_entry_ignore_
 
 GType rhythmdb_get_property_type (RhythmDB *db, guint property_id);
 
-void rhythmdb_entry_ref (RhythmDB *db, RhythmDBEntry *entry);
-void rhythmdb_entry_unref (RhythmDB *db, RhythmDBEntry *entry);
+RhythmDBEntry* rhythmdb_entry_ref (RhythmDBEntry *entry);
+void rhythmdb_entry_unref (RhythmDBEntry *entry);
 
 G_END_DECLS
 
diff -u -p -u -r1.7 rb-play-order-random.c
--- shell/rb-play-order-random.c	20 Apr 2006 20:43:29 -0000	1.7
+++ shell/rb-play-order-random.c	1 Jun 2006 05:53:58 -0000
@@ -333,7 +333,7 @@ rb_random_play_order_get_next (RBPlayOrd
 		rb_debug ("choosing random entry");
 		entry = rb_random_play_order_pick_entry (rorder);
 		if (entry) {
-			rhythmdb_entry_ref (rb_play_order_get_db (porder), entry);
+			rhythmdb_entry_ref (entry);
 			rb_history_append (history, entry);
 		}
 	} else {
@@ -433,7 +433,7 @@ rb_random_playing_entry_changed (RBPlayO
 		if (new_entry == rb_history_current (get_history (rorder))) {
 			/* Do nothing */
 		} else {
-			rhythmdb_entry_ref (rb_play_order_get_db (porder), new_entry);
+			rhythmdb_entry_ref (new_entry);
 			rb_history_set_playing (get_history (rorder), new_entry);
 		}
 	}
diff -u -p -u -r1.9 rb-play-order-shuffle.c
--- shell/rb-play-order-shuffle.c	20 Apr 2006 20:43:29 -0000	1.9
+++ shell/rb-play-order-shuffle.c	1 Jun 2006 05:53:59 -0000
@@ -320,7 +320,7 @@ add_randomly_to_history (RhythmDBEntry *
 	current_index = rb_history_get_current_index (sorder->priv->tentative_history);
 	/* Insert entry into the history at a random position between
 	 * just after current and the very end. */
-	rhythmdb_entry_ref (rb_play_order_get_db (RB_PLAY_ORDER (sorder)), entry);
+	rhythmdb_entry_ref (entry);
 	rb_history_insert_at_index (sorder->priv->tentative_history,
 				    entry,
 				    g_random_int_range (MIN (current_index, history_size-1) + 1,
@@ -417,7 +417,7 @@ rb_shuffle_playing_entry_changed (RBPlay
 		if (new_entry == rb_history_current (get_history (sorder))) {
 			/* Do nothing */
 		} else {
-			rhythmdb_entry_ref (rb_play_order_get_db (porder), new_entry);
+			rhythmdb_entry_ref (new_entry);
 
 			rb_history_set_playing (get_history (sorder), new_entry);
 		}
diff -u -p -u -r1.18 rb-play-order.c
--- shell/rb-play-order.c	20 Apr 2006 20:43:29 -0000	1.18
+++ shell/rb-play-order.c	1 Jun 2006 05:53:59 -0000
@@ -216,9 +216,9 @@ rb_play_order_set_property (GObject *obj
 		if (RB_PLAY_ORDER_GET_CLASS (porder)->playing_entry_changed)
 			RB_PLAY_ORDER_GET_CLASS (porder)->playing_entry_changed (porder, old_entry, entry);
 		if (old_entry)
-			rhythmdb_entry_unref (porder->priv->db, old_entry);
+			rhythmdb_entry_unref (old_entry);
 		if (entry)
-			rhythmdb_entry_ref (porder->priv->db, entry);
+			rhythmdb_entry_ref (entry);
 
 		rb_play_order_update_have_next_previous (porder);
 		break;
@@ -790,7 +790,7 @@ rb_play_order_update_have_next_previous 
 void
 rb_play_order_ref_entry_swapped (RhythmDBEntry *entry, RhythmDB *db)
 {
-	rhythmdb_entry_ref (db, entry);
+	rhythmdb_entry_ref (entry);
 }
 
 /**
@@ -804,5 +804,5 @@ rb_play_order_ref_entry_swapped (RhythmD
 void
 rb_play_order_unref_entry_swapped (RhythmDBEntry *entry, RhythmDB *db)
 {
-	rhythmdb_entry_unref (db, entry);
+	rhythmdb_entry_unref (entry);
 }
diff -u -p -u -r1.44 rb-shell-clipboard.c
--- shell/rb-shell-clipboard.c	20 May 2006 04:53:49 -0000	1.44
+++ shell/rb-shell-clipboard.c	1 Jun 2006 05:54:00 -0000
@@ -637,14 +637,14 @@ rb_shell_clipboard_process_deletions (RB
 			rb_shell_clipboard_sync (clipboard);
 
 		for (tem = finished; tem; tem = tem->next)
-			rhythmdb_entry_unref (clipboard->priv->db, tem->data);
+			rhythmdb_entry_unref (tem->data);
 		g_list_free (finished);
 
 		return processed;
 	} else {
 		/* Fast path for when there's nothing in the clipboard */
 		while ((entry = g_async_queue_try_pop (clipboard->priv->deleted_queue)) != NULL)
-			rhythmdb_entry_unref (clipboard->priv->db, entry);
+			rhythmdb_entry_unref (entry);
 		return FALSE;
 	}
 }
@@ -680,7 +680,7 @@ rb_shell_clipboard_entry_deleted_cb (Rhy
 				     RhythmDBEntry *entry,
 				     RBShellClipboard *clipboard)
 {
-	rhythmdb_entry_ref (db, entry);
+	rhythmdb_entry_ref (entry);
 	g_async_queue_push (clipboard->priv->deleted_queue, entry);
 }
 
diff -u -p -u -r1.20 rb-auto-playlist-source.c
--- sources/rb-auto-playlist-source.c	23 May 2006 23:18:18 -0000	1.20
+++ sources/rb-auto-playlist-source.c	1 Jun 2006 05:54:00 -0000
@@ -634,6 +634,7 @@ rb_auto_playlist_source_do_query (RBAuto
 					 source, 0);
 		rhythmdb_do_full_query_async_parsed (db, 
 						     RHYTHMDB_QUERY_RESULTS (query_model), 
+						     NULL,
 						     query);
 		g_object_unref (G_OBJECT (query_model));
 	}
@@ -676,6 +677,7 @@ rb_auto_playlist_source_set_query (RBAut
 	rb_library_browser_set_model (priv->browser, priv->cached_all_query, TRUE);
 	rhythmdb_do_full_query_async_parsed (db, 
 					     RHYTHMDB_QUERY_RESULTS (priv->cached_all_query), 
+					     NULL,
 					     query);
 
 
diff -u -p -u -r1.10 rb-browser-source.c
--- sources/rb-browser-source.c	25 May 2006 07:20:48 -0000	1.10
+++ sources/rb-browser-source.c	1 Jun 2006 05:54:00 -0000
@@ -465,6 +465,7 @@ rb_browser_source_constructor (GType typ
 	rb_library_browser_set_model (source->priv->browser, source->priv->cached_all_query, TRUE);
 	rhythmdb_do_full_query_async (source->priv->db,
 				      RHYTHMDB_QUERY_RESULTS (source->priv->cached_all_query),
+				      NULL,
 				      RHYTHMDB_QUERY_PROP_EQUALS, RHYTHMDB_PROP_TYPE, source->priv->entry_type,
 				      RHYTHMDB_QUERY_END);
 
@@ -875,6 +876,7 @@ rb_browser_source_do_query (RBBrowserSou
 					 source, 0);
 		rhythmdb_do_full_query_async_parsed (source->priv->db,
 						     RHYTHMDB_QUERY_RESULTS (query_model),
+						     NULL,
 						     query);
 		g_object_unref (G_OBJECT (query_model));
 	}
diff -u -p -u -r1.121 rb-iradio-source.c
--- sources/rb-iradio-source.c	9 May 2006 23:04:30 -0000	1.121
+++ sources/rb-iradio-source.c	1 Jun 2006 05:54:02 -0000
@@ -748,6 +748,7 @@ rb_iradio_source_do_query (RBIRadioSourc
 
 	rhythmdb_do_full_query_parsed (source->priv->db, 
 				       RHYTHMDB_QUERY_RESULTS (genre_query_model), 
+				       NULL,
 				       query);
 
 	rhythmdb_query_free (query);
diff -u -p -u -r1.170 rb-library-source.c
--- sources/rb-library-source.c	29 May 2006 04:47:09 -0000	1.170
+++ sources/rb-library-source.c	1 Jun 2006 05:54:02 -0000
@@ -953,7 +953,7 @@ layout_example_label_update (RBLibrarySo
 	sample_entry = rhythmdb_entry_example_new (source->priv->db, RHYTHMDB_ENTRY_TYPE_SONG, NULL);
 	file_value = filepath_parse_pattern (file_pattern, sample_entry);
 	path_value = filepath_parse_pattern (path_pattern, sample_entry);
-	rhythmdb_entry_unref (source->priv->db, sample_entry);
+	rhythmdb_entry_unref (sample_entry);
 
 	example = g_build_filename (G_DIR_SEPARATOR_S, path_value, file_value, NULL);
 	g_free (file_value);
diff -u -p -u -r1.69 rb-podcast-source.c
--- sources/rb-podcast-source.c	18 May 2006 11:21:07 -0000	1.69
+++ sources/rb-podcast-source.c	1 Jun 2006 05:54:03 -0000
@@ -687,6 +687,7 @@ rb_podcast_source_constructor (GType typ
 				      RHYTHMDB_QUERY_END);
 	rhythmdb_do_full_query_parsed (source->priv->db, 
 				       RHYTHMDB_QUERY_RESULTS (query_model), 
+				       NULL,
 				       query);
 
 	rhythmdb_query_free (query);
@@ -1216,6 +1217,7 @@ rb_podcast_source_do_query (RBPodcastSou
 	query = construct_query_from_selection (source);
 	rhythmdb_do_full_query_async_parsed (source->priv->db,
 					     RHYTHMDB_QUERY_RESULTS (query_model),
+					     NULL,
 					     query);
 		
 	rhythmdb_query_free (query);
diff -u -p -u -r1.21 rb-static-playlist-source.c
--- sources/rb-static-playlist-source.c	14 May 2006 01:56:40 -0000	1.21
+++ sources/rb-static-playlist-source.c	1 Jun 2006 05:54:04 -0000
@@ -571,9 +571,9 @@ rb_static_playlist_source_add_location_i
 			return;
 		}
 
-		rhythmdb_entry_ref (db, entry);
+		rhythmdb_entry_ref (entry);
 		rhythmdb_query_model_add_entry (priv->base_model, entry, index);
-		rhythmdb_entry_unref (db, entry);
+		rhythmdb_entry_unref (entry);
 	}
 
 	rb_playlist_source_add_to_map (psource, location);
diff -u -p -u -r1.12 rb-library-browser.c
--- widgets/rb-library-browser.c	14 May 2006 01:56:41 -0000	1.12
+++ widgets/rb-library-browser.c	1 Jun 2006 05:54:04 -0000
@@ -542,6 +542,7 @@ rebuild_child_model (RBLibraryBrowser *w
 			rhythmdb_query_model_chain (child_model, base_model, FALSE);
 			rhythmdb_do_full_query_parsed (priv->db,
 						       RHYTHMDB_QUERY_RESULTS (child_model),
+						       NULL,
 						       query);
 		}
 		rhythmdb_query_free (query);
