banshee r3428 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.SmartPlaylist src/Core/Banshee.ThickClient/Banshee.Gui



Author: gburt
Date: Wed Mar 12 19:35:06 2008
New Revision: 3428
URL: http://svn.gnome.org/viewvc/banshee?rev=3428&view=rev

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

	* src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs: Call
	RefreshAndReload on smart playlist Refresh action.

	* src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistCore.cs:
	Call RefreshAndReload when loading the smart playlists if we just migrated
	them.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistCore.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistCore.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistCore.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistCore.cs	Wed Mar 12 19:35:06 2008
@@ -38,6 +38,8 @@
         private DateTime start;
         private uint timeout_id = 0;
 
+        private bool migrated_this_run = false;
+
         private double cpu_ms_since_last_check = 0;
         public double CpuTime {
             get { return cpu_ms_since_last_check; }
@@ -47,6 +49,7 @@
         public SmartPlaylistCore()
         {
             if (Migrator.MigrateAll ()) {
+                migrated_this_run = true;
                 // Listen for added/removed sources and added/changed songs
                 ServiceManager.SourceManager.SourceAdded += HandleSourceAdded;
                 ServiceManager.SourceManager.SourceRemoved += HandleSourceRemoved;
@@ -67,7 +70,9 @@
             if (args.Source == ServiceManager.SourceManager.DefaultSource) {
                 foreach (SmartPlaylistSource pl in SmartPlaylistSource.LoadAll ()) {
                     playlists.Add (pl);
-                    //pl.Reload ();
+                    if (migrated_this_run) {
+                        pl.RefreshAndReload ();
+                    }
                     ServiceManager.SourceManager.DefaultSource.AddChildSource (pl);
                 }
                 return;

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs	Wed Mar 12 19:35:06 2008
@@ -275,7 +275,7 @@
             SmartPlaylistSource playlist = ActionSource as SmartPlaylistSource;
 
             if (playlist != null && playlist.CanRefresh) {
-                playlist.Reload ();
+                playlist.RefreshAndReload ();
             }
         }
 



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