Skip to content
Browse files

Don't clobber path history when running a search

  • Loading branch information...
1 parent a629a7e commit a18beb656708cc1c1bfe43c3c7f03fb3fc1265ba @garbear garbear committed
View
9 xbmc/filesystem/DirectoryHistory.cpp
@@ -118,6 +118,15 @@ void CDirectoryHistory::ClearPathHistory()
m_vecPathHistory.clear();
}
+void CDirectoryHistory::ClearSearchHistory()
+{
+ for (vector<CPathHistoryItem>::iterator it = m_vecPathHistory.begin(); it != m_vecPathHistory.end(); ++it)
+ {
+ if (it->GetPath().Left(14) == "musicsearch://")
+ it = m_vecPathHistory.erase(it);
+ }
+}
+
void CDirectoryHistory::DumpPathHistory()
{
// debug log
View
1 xbmc/filesystem/DirectoryHistory.h
@@ -59,6 +59,7 @@ class CDirectoryHistory
CStdString GetParentPath(bool filter = false);
CStdString RemoveParentPath(bool filter = false);
void ClearPathHistory();
+ void ClearSearchHistory();
void DumpPathHistory();
private:
View
2 xbmc/music/windows/GUIWindowMusicNav.cpp
@@ -772,7 +772,7 @@ void CGUIWindowMusicNav::OnSearchUpdate()
if (!search.IsEmpty())
{
CStdString path = "musicsearch://" + search + "/";
- m_history.ClearPathHistory();
+ m_history.ClearSearchHistory();
Update(path);
}
else if (m_vecItems->IsVirtualDirectoryRoot())

0 comments on commit a18beb6

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