Index: SmartPlaylistCore.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/Banshee.Base/Banshee.SmartPlaylist/SmartPlaylistCore.cs,v
retrieving revision 1.6
diff -u -p -r1.6 SmartPlaylistCore.cs
--- SmartPlaylistCore.cs	2 Oct 2006 04:57:39 -0000	1.6
+++ SmartPlaylistCore.cs	18 Oct 2006 05:54:52 -0000
@@ -19,6 +19,7 @@ namespace Banshee.SmartPlaylist
         private Menu musicMenu;
         private MenuItem addItem;
         private MenuItem addFromSearchItem;
+        private bool liveUpdating;
 
         private static SmartPlaylistCore instance = null;
 
@@ -44,6 +45,31 @@ namespace Banshee.SmartPlaylist
             }
         }
         
+        public bool LiveUpdating {
+        	get { return liveUpdating; }
+        	set {
+        		if (value != liveUpdating) {
+        			liveUpdating = value;
+        			if (value = true) {
+        				SourceManager.SourceAdded += HandleSourceAdded;
+            			SourceManager.SourceRemoved += HandleSourceRemoved;
+        				Globals.Library.TrackAdded += HandleTrackAdded;
+            			Globals.Library.TrackRemoved += HandleTrackRemoved;
+            		} else {
+            			SourceManager.SourceAdded -= HandleSourceAdded;
+            			SourceManager.SourceRemoved -= HandleSourceRemoved;
+            			Globals.Library.TrackAdded -= HandleTrackAdded;
+            			Globals.Library.TrackRemoved -= HandleTrackRemoved;
+            		}
+        			if(Globals.Library.IsLoaded) {
+		                HandleLibraryReloaded (null, null);
+		            } else {
+		                Globals.Library.Reloaded += HandleLibraryReloaded;
+		            }
+        		}
+        	}
+        }
+        
         public override string [] Authors {
             get {
                 return new string [] {
@@ -95,16 +121,7 @@ namespace Banshee.SmartPlaylist
             }
 
             // Listen for added/removed sources and added/changed songs
-            SourceManager.SourceAdded += HandleSourceAdded;
-            SourceManager.SourceRemoved += HandleSourceRemoved;
-
-            if(Globals.Library.IsLoaded) {
-                HandleLibraryReloaded (null, null);
-            } else {
-                Globals.Library.Reloaded += HandleLibraryReloaded;
-            }
-            Globals.Library.TrackAdded += HandleTrackAdded;
-            Globals.Library.TrackRemoved += HandleTrackRemoved;
+			LiveUpdating = true;
 
             // Load existing smart playlists
             IDataReader reader = Globals.Library.Db.Query(String.Format(
@@ -167,8 +184,7 @@ namespace Banshee.SmartPlaylist
                 musicMenu.Remove(addFromSearchItem);
             }
 
-            SourceManager.SourceAdded -= HandleSourceAdded;
-            SourceManager.SourceRemoved -= HandleSourceRemoved;
+            LiveUpdating = false;
 
             foreach (SmartPlaylistSource playlist in playlists)
                 LibrarySource.Instance.RemoveChildSource(playlist);
@@ -193,8 +209,13 @@ namespace Banshee.SmartPlaylist
 
             while (reader.Read()) {
                 LibraryTrackInfo track = Globals.Library.GetTrack (Convert.ToInt32(reader[0]));
-                if (track != null)
-                    track.Changed += HandleTrackChanged;
+                if (track != null) {
+                    if (liveUpdating) {
+                    	track.Changed += HandleTrackChanged;
+                    } else {
+                    	track.Changed -= HandleTrackChanged;
+                    }
+                }
             }
 
             reader.Dispose();
