banshee r4408 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.Services/Banshee.Sources src/Dap/Banshee.Dap/Banshee.Dap
- From: gburt svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4408 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.Services/Banshee.Sources src/Dap/Banshee.Dap/Banshee.Dap
- Date: Wed, 20 Aug 2008 18:33:23 +0000 (UTC)
Author: gburt
Date: Wed Aug 20 18:33:23 2008
New Revision: 4408
URL: http://svn.gnome.org/viewvc/banshee?rev=4408&view=rev
Log:
2008-08-20 Gabriel Burt <gabriel burt gmail com>
* src/Dap/Banshee.Dap/Banshee.Dap/MediaGroupSource.cs: Use the
UnfilteredFileSize so that the dap info bar isn't inaccurate when
filtering (BGO #537366).
* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs:
Get the unfiltered total file size in addition to the count.
* src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs: Make the
getter for DatabaseTrackModel public.
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs
trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/MediaGroupSource.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 Wed Aug 20 18:33:23 2008
@@ -57,7 +57,7 @@
private long filtered_count;
private TimeSpan filtered_duration;
- private long filtered_filesize;
+ private long filtered_filesize, filesize;
private ISortableColumn sort_column;
private string sort_query;
@@ -172,6 +172,7 @@
{
cache.Clear ();
count = 0;
+ filesize = 0;
filtered_count = 0;
OnCleared ();
}
@@ -201,9 +202,13 @@
protected virtual void UpdateUnfilteredAggregates ()
{
HyenaSqliteCommand count_command = new HyenaSqliteCommand (String.Format (
- "SELECT COUNT(*) {0}", UnfilteredQuery
+ "SELECT COUNT(*), SUM(CoreTracks.FileSize) {0}", UnfilteredQuery
));
- count = connection.Query<long> (count_command);
+
+ using (HyenaDataReader reader = new HyenaDataReader (connection.Query (count_command))) {
+ count = reader.Get<long> (0);
+ filesize = reader.Get<long> (1);
+ }
}
public override void Reload ()
@@ -353,6 +358,10 @@
get { return filtered_filesize; }
}
+ public long UnfilteredFileSize {
+ get { return filesize; }
+ }
+
public int UnfilteredCount {
get { return (int) count; }
set { count = value; }
@@ -403,7 +412,7 @@
{
condition = condition == null ? part : String.Format ("{0} AND {1}", condition, part);
}
-
+
public string Condition {
get { return condition; }
}
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs Wed Aug 20 18:33:23 2008
@@ -97,11 +97,11 @@
get { return true; }
}
- protected DatabaseTrackListModel DatabaseTrackModel {
+ public DatabaseTrackListModel DatabaseTrackModel {
get {
return track_model ?? track_model = new DatabaseTrackListModel (ServiceManager.DbConnection, TrackProvider, this);
}
- set { track_model = value; }
+ protected set { track_model = value; }
}
private IDatabaseTrackModelCache track_cache;
@@ -475,7 +475,7 @@
AddSelectedTracks (source);
}
}
-
+
#endregion
#region Protected Methods
Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/MediaGroupSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/MediaGroupSource.cs (original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/MediaGroupSource.cs Wed Aug 20 18:33:23 2008
@@ -94,10 +94,7 @@
}
public long BytesUsed {
- get {
- IFileSizeAggregator aggregator = this as IFileSizeAggregator;
- return aggregator == null ? 0 : aggregator.FileSize;
- }
+ get { return DatabaseTrackModel.UnfilteredFileSize; }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]