Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/banshee/ChangeLog,v
retrieving revision 1.670
diff -u -r1.670 ChangeLog
--- ChangeLog	25 Sep 2006 20:28:32 -0000	1.670
+++ ChangeLog	26 Sep 2006 04:23:48 -0000
@@ -1,3 +1,13 @@
+2006-09-25  Gabriel Burt  <gabriel.burt@gmail.com>
+
+	* src/PlayerInterface.cs: Set the SearchEntry as Ready only when
+	appropriate to avoid being told to search when we are just cancelling the
+	search b/c the source is being changed, thus preventing two extra playlist
+	model reloads.
+
+	* src/Banshee.Widgets/SearchEntry.cs: Add Ready property, and only raise
+	the Changed event when we are Ready.  Refactor OnChanged raising code.
+
 2006-09-25  Aaron Bockover  <abock@gnome.org>
 
 	258% hot sweet action: All of Banshee's dbus-sharp code has been ported
Index: src/PlayerInterface.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/PlayerInterface.cs,v
retrieving revision 1.218
diff -u -r1.218 PlayerInterface.cs
--- src/PlayerInterface.cs	21 Sep 2006 04:05:57 -0000	1.218
+++ src/PlayerInterface.cs	26 Sep 2006 04:23:53 -0000
@@ -1083,6 +1083,7 @@
                 return;
             }
 
+            searchEntry.Ready = false;
             searchEntry.CancelSearch();
             
             if(source is DapSource) {
@@ -1112,6 +1113,8 @@
             UpdateSourceView();
                 
             OnPlaylistViewSelectionChanged(playlistView.Selection, new EventArgs());
+
+            searchEntry.Ready = true;
         }
         
         private void UpdateDapDiskUsageBar(DapSource dapSource)
Index: src/Banshee.Widgets/SearchEntry.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/Banshee.Widgets/SearchEntry.cs,v
retrieving revision 1.9
diff -u -r1.9 SearchEntry.cs
--- src/Banshee.Widgets/SearchEntry.cs	11 Sep 2006 20:31:41 -0000	1.9
+++ src/Banshee.Widgets/SearchEntry.cs	26 Sep 2006 04:23:55 -0000
@@ -58,6 +58,7 @@
         
         private bool emptyEmitted;
         private uint timeoutId;
+        private bool ready = false;
         
         public event EventHandler EnterPress;
         public event EventHandler Changed;
@@ -315,10 +316,7 @@
             
             entry.HasFocus = true;
             
-            EventHandler handler = Changed;
-            if(handler != null) {
-                handler(this, new EventArgs());
-            }
+            OnChanged(this, new EventArgs());
         }
         
         private void OnMenuDeactivated(object o, EventArgs args)
@@ -327,6 +325,16 @@
             menuActive = false;
         }
         
+        protected virtual void OnChanged(object o, EventArgs args)
+        {
+            if (Ready) {
+                EventHandler handler = Changed;
+                if(handler != null) {
+                    handler(o, args);
+                }
+            }
+        }
+
         private void OnEntryActivated(object o, EventArgs args)
         {
             EventHandler handler = EnterPress;
@@ -337,10 +345,7 @@
 
         private bool OnTimeout () 
         {
-            EventHandler handler = Changed;
-            if(handler != null && !emptyEmitted) {
-                handler(this, new EventArgs());
-            }
+            OnChanged(this, new EventArgs());
 
             emptyEmitted = entry.Text.Length == 0;
             return false;
@@ -420,6 +425,11 @@
             get {
                 return Query != null && Query != String.Empty;
             }
+        }
+
+        public bool Ready {
+            get { return ready; }
+            set { ready = value; }
         }
     }
 }
