banshee r3387 - in trunk/banshee: . src/Libraries/Hyena/Hyena.Data.Sqlite



Author: gburt
Date: Wed Mar  5 22:29:03 2008
New Revision: 3387
URL: http://svn.gnome.org/viewvc/banshee?rev=3387&view=rev

Log:
2008-03-05  Gabriel Burt  <gabriel burt gmail com>

	* src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs: Small but
	powerful fix - was not clearing the selection between reloads at all.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs

Modified: trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs	Wed Mar  5 22:29:03 2008
@@ -290,7 +290,6 @@
 
         private void RestoreSelection ()
         {
-            bool cleared = false;
             long selected_id = -1;
             long first_id = FirstOrderId;
 
@@ -299,16 +298,18 @@
                 first_id -= 1;
             }
 
+            model.Selection.Clear (false);
+
             using (IDataReader reader = connection.Query (get_selection_command)) {
                 while (reader.Read ()) {
-                    if (!cleared) {
-                        model.Selection.Clear (false);
-                        cleared = true;
-                    }
                     selected_id = Convert.ToInt64 (reader[0]) - first_id;
                     model.Selection.QuietSelect ((int)selected_id);
                 }
             }
+
+            if (has_select_all_item && model.Selection.Count == 0) {
+                model.Selection.QuietSelect (0);
+            }
         }
 
         protected override void FetchSet (long offset, long limit)



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