banshee r4280 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Collection.Database src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data



Author: gburt
Date: Tue Jul 29 15:17:34 2008
New Revision: 4280
URL: http://svn.gnome.org/viewvc/banshee?rev=4280&view=rev

Log:
2008-07-29  Gabriel Burt  <gabriel burt gmail com>

	* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs:
	Make UpdateUnfilteredAggregates virtual, expose UnfilteredCount setter and
	Connection via protected properties.

	* src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastTrackListModel.cs:
	Use the above changes to show the # of new podcast items in the
	SourceView, instead of the total # of items.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs
   trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastTrackListModel.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs	Tue Jul 29 15:17:34 2008
@@ -77,6 +77,10 @@
             this.provider = provider;
             this.source = source;
         }
+        
+        protected HyenaSqliteConnection Connection {
+            get { return connection; }
+        }
 
         private bool initialized = false;
         public void Initialize (IDatabaseTrackModelCache cache)
@@ -194,7 +198,7 @@
             }
         }
 
-        private void UpdateUnfilteredAggregates ()
+        protected virtual void UpdateUnfilteredAggregates ()
         {
             HyenaSqliteCommand count_command = new HyenaSqliteCommand (String.Format (
                 "SELECT COUNT(*) {0}", UnfilteredQuery
@@ -351,6 +355,7 @@
         
         public int UnfilteredCount {
             get { return (int) count; }
+            set { count = value; }
         }
 
         public string UserQuery {

Modified: trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastTrackListModel.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastTrackListModel.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastTrackListModel.cs	Tue Jul 29 15:17:34 2008
@@ -73,6 +73,14 @@
                 ? GetSort ("Published", false)
                 : GetSort (SortColumn.SortKey, SortColumn.SortType == Hyena.Data.SortType.Ascending);
         }
+        
+        protected override void UpdateUnfilteredAggregates ()
+        {
+            HyenaSqliteCommand count_command = new HyenaSqliteCommand (String.Format (
+                "SELECT COUNT(*) {0} AND PodcastItems.IsRead = 0", UnfilteredQuery
+            ));
+            UnfilteredCount = Connection.Query<int> (count_command);
+        }
 
         public static string GetSort (string key, bool asc)
         {



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