banshee r4548 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Collection src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.Services/Banshee.Sources src/Core/Banshee.ThickClient/Banshee.Sources.Gui src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView
- From: gburt svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4548 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Collection src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.Services/Banshee.Sources src/Core/Banshee.ThickClient/Banshee.Sources.Gui src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView
- Date: Mon, 15 Sep 2008 20:30:13 +0000 (UTC)
Author: gburt
Date: Mon Sep 15 20:30:12 2008
New Revision: 4548
URL: http://svn.gnome.org/viewvc/banshee?rev=4548&view=rev
Log:
2008-09-15 Gabriel Burt <gabriel burt gmail com>
* src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs:
* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs:
* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs:
* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseFilterListModel.cs:
* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs:
* src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs:
* src/Core/Banshee.Services/Banshee.Collection/IFilterListModel.cs:
* src/Core/Banshee.Services/Banshee.Collection/FilterListModel.cs:
* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs: Fix
issue with the ListViews getting scrolled to the top of the list every
time you switched sources (BGO #551970).
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseFilterListModel.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection/FilterListModel.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection/IFilterListModel.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs
trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseFilterListModel.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseFilterListModel.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseFilterListModel.cs Mon Sep 15 20:30:12 2008
@@ -197,10 +197,12 @@
}
}
- public override void InvalidateCache ()
+ public override void InvalidateCache (bool notify)
{
cache.Clear ();
- OnReloaded ();
+ if (notify) {
+ OnReloaded ();
+ }
}
public abstract string FilterColumn { get; }
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 Mon Sep 15 20:30:12 2008
@@ -177,13 +177,15 @@
OnCleared ();
}
- public void InvalidateCache ()
+ public void InvalidateCache (bool notify)
{
if (cache == null) {
Log.ErrorFormat ("Called invalidate cache for {0}'s track model, but cache is null", source);
} else {
cache.Clear ();
- OnReloaded ();
+ if (notify) {
+ OnReloaded ();
+ }
}
}
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection/FilterListModel.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection/FilterListModel.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection/FilterListModel.cs Mon Sep 15 20:30:12 2008
@@ -89,7 +89,7 @@
protected set { filter_label = value; }
}
- public virtual void InvalidateCache ()
+ public virtual void InvalidateCache (bool notify)
{
}
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection/IFilterListModel.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection/IFilterListModel.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection/IFilterListModel.cs Mon Sep 15 20:30:12 2008
@@ -38,6 +38,6 @@
void Reload (bool notify);
string FilterName { get; }
string FilterLabel { get; }
- void InvalidateCache ();
+ void InvalidateCache (bool notify);
}
}
\ No newline at end of file
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 Mon Sep 15 20:30:12 2008
@@ -577,9 +577,9 @@
public override void Deactivate ()
{
- DatabaseTrackModel.InvalidateCache ();
+ DatabaseTrackModel.InvalidateCache (false);
foreach (IFilterListModel filter in AvailableFilters) {
- filter.InvalidateCache ();
+ filter.InvalidateCache (false);
}
}
@@ -638,10 +638,10 @@
protected void InvalidateCaches ()
{
- track_model.InvalidateCache ();
+ track_model.InvalidateCache (true);
foreach (IFilterListModel filter in CurrentFilters) {
- filter.InvalidateCache ();
+ filter.InvalidateCache (true);
}
}
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs Mon Sep 15 20:30:12 2008
@@ -146,10 +146,10 @@
public override void ResetSource ()
{
source = null;
- track_view.SetModel (null);
- artist_view.SetModel (null);
- album_view.SetModel (null);
- // genre_view.SetModel (null);
+ SetModel (track_view, null);
+ SetModel (artist_view, null);
+ SetModel (album_view, null);
+ // SetModel (genre_view, null);
track_view.HeaderVisible = false;
}
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs Mon Sep 15 20:30:12 2008
@@ -327,9 +327,15 @@
if (view.Model != null) {
model_positions[view.Model] = view.Vadjustment.Value;
}
+
+ if (model == null) {
+ view.SetModel (null);
+ return;
+ }
- if (!model_positions.ContainsKey (model))
- model_positions[model] = 0.0;
+ if (!model_positions.ContainsKey (model)) {
+ model_positions[model] = 0.0;
+ }
view.SetModel (model, model_positions[model]);
}
Modified: trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs Mon Sep 15 20:30:12 2008
@@ -123,10 +123,10 @@
{
//Console.WriteLine ("PSC.reset_source 1");
source = null;
- track_view.SetModel (null);
- unheard_view.SetModel (null);
- download_view.SetModel (null);
- feed_view.SetModel (null);
+ SetModel (track_view, null);
+ SetModel (unheard_view, null);
+ SetModel (download_view, null);
+ SetModel (feed_view, null);
track_view.HeaderVisible = false;
//Console.WriteLine ("PSC.reset_source 2");
}
Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs (original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs Mon Sep 15 20:30:12 2008
@@ -69,19 +69,19 @@
private void RefreshViewForModel (double? vpos)
{
+ if (Model == null) {
+ return;
+ }
+
UpdateAdjustments ();
if (vpos != null) {
ScrollTo ((double) vpos);
- } else {
- if (Model.Count <= RowsInView) {
- // If our view fits all rows at once, make sure we're scrolled to the top
- ScrollTo (0.0);
- } else {
- if (vadjustment != null) {
- ScrollTo (vadjustment.Value);
- }
- }
+ } else if (Model.Count <= RowsInView) {
+ // If our view fits all rows at once, make sure we're scrolled to the top
+ ScrollTo (0.0);
+ } else if (vadjustment != null) {
+ ScrollTo (vadjustment.Value);
}
if (Model != null && Selection != null) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]