--- ./widgets/rb-property-view.c	2005-03-31 23:31:34.000000000 +0200
+++ ../rb-dnd-0.8/widgets/rb-property-view.c	2005-03-31 23:26:42.000000000 +0200
@@ -115,16 +115,15 @@
 	TARGET_URIS,
 };
 
-#define N_TARGETS 2
-static const GtkTargetEntry targets_album  [N_TARGETS] = {
+static const GtkTargetEntry targets_album  [] = {
 	{ "text/x-rhythmbox-album",  0, TARGET_ALBUMS },
 	{ "text/uri-list", 0, TARGET_URIS },
 };
-static const GtkTargetEntry targets_genre  [N_TARGETS] = {
+static const GtkTargetEntry targets_genre  [] = {
 	{ "text/x-rhythmbox-genre",  0, TARGET_GENRE },
 	{ "text/uri-list", 0, TARGET_URIS },
 };
-static const GtkTargetEntry targets_artist [N_TARGETS] = {
+static const GtkTargetEntry targets_artist [] = {
 	{ "text/x-rhythmbox-artist", 0, TARGET_ARTISTS },
 	{ "text/uri-list", 0, TARGET_URIS },
 };
@@ -481,23 +480,26 @@
 }
 
 /*Going through hoops to avoid nested functions*/
-struct QueryModelCbStruct { RhythmDB* db; GString* reply; }; 
-static gboolean query_model_cb (GtkTreeModel *query_model,
-	GtkTreePath *path, GtkTreeIter *iter,
-	struct QueryModelCbStruct *data);
+struct QueryModelCbStruct { 
+	RhythmDB* db; 
+	GString* reply; 
+}; 
+
 static gboolean query_model_cb (GtkTreeModel *query_model,
-	GtkTreePath *path, GtkTreeIter *iter,
-	struct QueryModelCbStruct *data) {
+				GtkTreePath *path, GtkTreeIter *iter,
+				struct QueryModelCbStruct *data) 
+{
 	const char* uri;
 	RhythmDBEntry* entry;
 
 	gtk_tree_model_get (query_model, iter, 0, &entry, -1);
-	uri = rhythmdb_entry_get_string (data->db, entry, RHYTHMDB_PROP_LOCATION);
+	uri = rhythmdb_entry_get_string (data->db, entry, 
+					 RHYTHMDB_PROP_LOCATION);
 	g_string_append (data->reply, uri);
 	g_string_append (data->reply, "\r\n");
 
 	rhythmdb_entry_unref (data->db, entry);
-	return (FALSE);
+	return FALSE;
 }
 
 static void
@@ -507,30 +509,30 @@
 {
 	if (info == TARGET_URIS) {
 		/*We get all entries for selected property entries - other filters that have been set don't apply, the user can have them by selecting all then dragging from the entry view*/
-		RBPropertyView* view;
-			view = RB_PROPERTY_VIEW (data);
+		RBPropertyView* view = RB_PROPERTY_VIEW (data);
 		RhythmDB* db = view->priv->db;
-		
 		GList* selected_rows;
 		GtkTreeModel* query_model = GTK_TREE_MODEL (rhythmdb_query_model_new_empty(db));
 		GtkTreeModel* model;
 		GPtrArray* subquery = g_ptr_array_new();
 		GString* reply = g_string_new ("");
-		GList* row;
 		GtkTreeIter iter;
 		gboolean is_all;
+		struct QueryModelCbStruct tmp;
 
 		selected_rows = gtk_tree_selection_get_selected_rows (
 			view->priv->selection, &model);
 
 		gtk_tree_model_get_iter (model, &iter, (GtkTreePath*)selected_rows->data);		
 		gtk_tree_model_get (model, &iter,
-				RHYTHMDB_PROPERTY_MODEL_COLUMN_PRIORITY, &is_all, -1);
+				    RHYTHMDB_PROPERTY_MODEL_COLUMN_PRIORITY, 
+				    &is_all, -1);
 		if (!is_all) {
+			GList* row;
+
 			for (row=selected_rows; row; row = row->next) {
-				gtk_tree_model_get_iter (model, &iter, (GtkTreePath*)row->data);
 				char* name;
-
+				gtk_tree_model_get_iter (model, &iter, (GtkTreePath*)row->data);
 				gtk_tree_model_get (model, &iter,
 					RHYTHMDB_PROPERTY_MODEL_COLUMN_TITLE, &name, -1);
 				if (row->next) {
@@ -550,29 +552,31 @@
 			}
 			/*filter out radios*/
 			rhythmdb_do_full_query (db, query_model,
-					RHYTHMDB_QUERY_PROP_EQUALS,
-						RHYTHMDB_PROP_TYPE, RHYTHMDB_ENTRY_TYPE_SONG,
-					RHYTHMDB_QUERY_SUBQUERY,
+						RHYTHMDB_QUERY_PROP_EQUALS,
+						RHYTHMDB_PROP_TYPE, 
+						RHYTHMDB_ENTRY_TYPE_SONG,
+						RHYTHMDB_QUERY_SUBQUERY,
 						subquery,
 				RHYTHMDB_QUERY_END);
 		} else {
 			/*filter out radios*/
 			rhythmdb_do_full_query (db, query_model,
-					RHYTHMDB_QUERY_PROP_EQUALS,
-						RHYTHMDB_PROP_TYPE, RHYTHMDB_ENTRY_TYPE_SONG,
-				RHYTHMDB_QUERY_END);			
+						RHYTHMDB_QUERY_PROP_EQUALS,
+						RHYTHMDB_PROP_TYPE, 
+						RHYTHMDB_ENTRY_TYPE_SONG,
+						RHYTHMDB_QUERY_END);
 		}
 
 		g_list_foreach (selected_rows, (GFunc)gtk_tree_path_free, NULL);
 		g_list_free (selected_rows);
 
-		struct QueryModelCbStruct tmp;
-			tmp.db = db; tmp.reply = reply;
+		tmp.db = db; 
+		tmp.reply = reply;
 		/*Too bad that we're on the main thread. Why doesn't gtk call us async?
 		How does file-roller manage? - it seems it refuses the drop when it isn't done unpacking. In which case, we should tweak the drop acknowledgement, and prepare the query using do_full_query_async. The query would be hooked to the drag context.*/
 		gtk_tree_model_foreach (query_model,
-			(GtkTreeModelForeachFunc)query_model_cb,
-			&tmp);
+					(GtkTreeModelForeachFunc)query_model_cb,
+					&tmp);
 		
 		g_object_unref (query_model);
 
@@ -585,7 +589,6 @@
 		/*We could add more cases and more targets, like an albums target for artists. OTOH, no one uses these targets for now, so they could be completely removed*/
 		/*The part below doesn't allow multiple selection - delete it?*/
 		RBPropertyView *view;
-
 		GtkTreeIter iter;
 		char* title;
 		GtkTreeModel *model;
@@ -616,7 +619,7 @@
 	RBPropertyViewClass *klass;
 	GObjectClass *parent_class; 
 	const GtkTargetEntry *targets;
- 
+	gint n_elements;
 
 
 	klass = RB_PROPERTY_VIEW_CLASS (g_type_class_peek (RB_TYPE_PROPERTY_VIEW));
@@ -633,12 +636,15 @@
 	{
 	case RHYTHMDB_PROP_GENRE:
 		targets = targets_genre;
+		n_elements = G_N_ELEMENTS (targets_genre);
 		break;
         case RHYTHMDB_PROP_ALBUM:
                 targets = targets_album;
+		n_elements = G_N_ELEMENTS (targets_album);
 		break;
         case RHYTHMDB_PROP_ARTIST:
                 targets = targets_artist;
+		n_elements = G_N_ELEMENTS (targets_artist);
 		break;
 	default:
 		targets = NULL;
@@ -647,7 +653,7 @@
 
         gtk_drag_source_set (GTK_WIDGET(view->priv->treeview),
                              GDK_BUTTON1_MASK,
-                             targets, N_TARGETS,
+                             targets, n_elements,
                              GDK_ACTION_COPY);
 
 	g_signal_connect_object (G_OBJECT (view->priv->treeview), "drag_data_get",
