Skip to content
This repository
Browse code

Don't clobber path history when running a search

  • Loading branch information...
commit a18beb656708cc1c1bfe43c3c7f03fb3fc1265ba 1 parent a629a7e
Garrett Brown authored June 25, 2013
9  xbmc/filesystem/DirectoryHistory.cpp
@@ -118,6 +118,15 @@ void CDirectoryHistory::ClearPathHistory()
118 118
   m_vecPathHistory.clear();
119 119
 }
120 120
 
  121
+void CDirectoryHistory::ClearSearchHistory()
  122
+{
  123
+  for (vector<CPathHistoryItem>::iterator it = m_vecPathHistory.begin(); it != m_vecPathHistory.end(); ++it)
  124
+  {
  125
+    if (it->GetPath().Left(14) == "musicsearch://")
  126
+      it = m_vecPathHistory.erase(it);
  127
+  }
  128
+}
  129
+
121 130
 void CDirectoryHistory::DumpPathHistory()
122 131
 {
123 132
   // debug log
1  xbmc/filesystem/DirectoryHistory.h
@@ -59,6 +59,7 @@ class CDirectoryHistory
59 59
   CStdString GetParentPath(bool filter = false);
60 60
   CStdString RemoveParentPath(bool filter = false);
61 61
   void ClearPathHistory();
  62
+  void ClearSearchHistory();
62 63
   void DumpPathHistory();
63 64
 
64 65
 private:
2  xbmc/music/windows/GUIWindowMusicNav.cpp
@@ -772,7 +772,7 @@ void CGUIWindowMusicNav::OnSearchUpdate()
772 772
   if (!search.IsEmpty())
773 773
   {
774 774
     CStdString path = "musicsearch://" + search + "/";
775  
-    m_history.ClearPathHistory();
  775
+    m_history.ClearSearchHistory();
776 776
     Update(path);
777 777
   }
778 778
   else if (m_vecItems->IsVirtualDirectoryRoot())

0 notes on commit a18beb6

Please sign in to comment.
Something went wrong with that request. Please try again.