rhythmbox r5701 - in trunk: . rhythmdb



Author: hadess
Date: Thu May  8 10:20:43 2008
New Revision: 5701
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=5701&view=rev

Log:
2008-05-08  Bastien Nocera  <hadess hadess net>

	* rhythmdb/rhythmdb-query-model.c (query_model_chain_can_reorder),
	(rhythmdb_query_model_row_drop_possible),
	(rhythmdb_query_model_row_drop_position): Patch from Jonathan Matthew
	<jonathan d14n org> to not make sorted queries look like drag
	destinations (Closes: #531759)



Modified:
   trunk/ChangeLog
   trunk/rhythmdb/rhythmdb-query-model.c

Modified: trunk/rhythmdb/rhythmdb-query-model.c
==============================================================================
--- trunk/rhythmdb/rhythmdb-query-model.c	(original)
+++ trunk/rhythmdb/rhythmdb-query-model.c	Thu May  8 10:20:43 2008
@@ -1937,14 +1937,13 @@
 	return FALSE;
 }
 
+/* 
+ * determines whether reordering is possible by checking up
+ * the chain for a model with a sort function set.
+ */
 static gboolean
-rhythmdb_query_model_row_drop_possible (RbTreeDragDest *drag_dest,
-					GtkTreePath *dest,
-					GtkTreeViewDropPosition pos,
-					GtkSelectionData *selection_data)
+query_model_chain_can_reorder (RhythmDBQueryModel *model)
 {
-	RhythmDBQueryModel *model = RHYTHMDB_QUERY_MODEL (drag_dest);
-
 	while (model) {
 		if (model->priv->sort_func != NULL)
 			return FALSE;
@@ -1955,12 +1954,23 @@
 }
 
 static gboolean
+rhythmdb_query_model_row_drop_possible (RbTreeDragDest *drag_dest,
+					GtkTreePath *dest,
+					GtkTreeViewDropPosition pos,
+					GtkSelectionData *selection_data)
+{
+	RhythmDBQueryModel *model = RHYTHMDB_QUERY_MODEL (drag_dest);
+	return query_model_chain_can_reorder (model);
+}
+
+static gboolean
 rhythmdb_query_model_row_drop_position (RbTreeDragDest *drag_dest,
 					GtkTreePath *dest_path,
 					GList *targets,
 					GtkTreeViewDropPosition *pos)
 {
-	return TRUE;
+	RhythmDBQueryModel *model = RHYTHMDB_QUERY_MODEL (drag_dest);
+	return query_model_chain_can_reorder (model);
 }
 
 static void



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