[banshee] [DatabaseSource] Improve NeedsReloadWhenFieldChanged code
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] [DatabaseSource] Improve NeedsReloadWhenFieldChanged code
- Date: Thu, 3 Dec 2009 02:40:51 +0000 (UTC)
commit c9153eb41793c1cb6b5408d945d89cd9e9bb723f
Author: Gabriel Burt <gabriel burt gmail com>
Date: Wed Dec 2 18:35:20 2009 -0800
[DatabaseSource] Improve NeedsReloadWhenFieldChanged code
.../Banshee.Sources/DatabaseSource.cs | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs b/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs
index 23c8f2c..6227f11 100644
--- a/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs
+++ b/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs
@@ -188,21 +188,25 @@ namespace Banshee.Sources
return true;
// If it's the artist or album name, then we care, since it affects the browser
+ // FIXME this should be based on what filters (aka browsers) are active. InternetRadio,
+ // for example, has only a Genre filter.
if (field == Banshee.Query.BansheeQuery.ArtistField || field == Banshee.Query.BansheeQuery.AlbumField) {
return true;
}
- ISortableColumn sort_column = (TrackModel is DatabaseTrackListModel)
- ? (TrackModel as DatabaseTrackListModel).SortColumn : null;
+ if (DatabaseTrackModel == null) {
+ Log.Error ("DatabaseTrackModel should not be null in DatabaseSource.NeedsReloadWhenFieldChanged");
+ return false;
+ }
// If it's the field we're sorting by, then yes, we care
+ var sort_column = DatabaseTrackModel.SortColumn;
if (sort_column != null && sort_column.Field == field) {
return true;
}
// Make sure the query isn't dependent on this field
- QueryNode query = (TrackModel is DatabaseTrackListModel)
- ? (TrackModel as DatabaseTrackListModel).Query : null;
+ QueryNode query = DatabaseTrackModel.Query;
if (query != null) {
if (query != last_query) {
query_fields = new List<QueryField> (query.GetFields ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]