diff options
author | montellese <montellese@xbmc.org> | 2012-10-17 10:27:58 +0200 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2012-10-17 11:57:10 +0200 |
commit | 62719d0dba425852d157639610e57152fdede209 (patch) | |
tree | 25c721e8ef7d75d6c9c934a64f11182d56dee640 | |
parent | 7423d82de3ecce29eee31230b454e4b17e81fad9 (diff) |
CGUIMediaWindow: keep details/members of m_vecItems when just refreshing the current item list in Update()
-rw-r--r-- | xbmc/windows/GUIMediaWindow.cpp | 21 | ||||
-rw-r--r-- | xbmc/windows/GUIMediaWindow.h | 2 |
2 files changed, 15 insertions, 8 deletions
diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp index 418888064d..913069de8b 100644 --- a/xbmc/windows/GUIMediaWindow.cpp +++ b/xbmc/windows/GUIMediaWindow.cpp @@ -566,10 +566,13 @@ void CGUIMediaWindow::UpdateButtons() SET_CONTROL_LABEL2(CONTROL_BTN_FILTER, GetProperty("filter").asString()); } -void CGUIMediaWindow::ClearFileItems() +void CGUIMediaWindow::ClearFileItems(bool itemsOnly /* = false */) { m_viewControl.Clear(); - m_vecItems->Clear(); // will clean up everything + if (itemsOnly) + m_vecItems->ClearItems(); + else + m_vecItems->Clear(); m_unfilteredItems->Clear(); } @@ -724,9 +727,10 @@ bool CGUIMediaWindow::Update(const CStdString &strDirectory) GetDirectoryHistoryString(pItem.get(), strSelectedItem); } } + + bool refresh = strDirectory == m_vecItems->GetPath(); CStdString strCurrentDirectory = m_vecItems->GetPath(); - m_history.SetSelectedItem(strSelectedItem, strCurrentDirectory); CFileItemList items; @@ -750,10 +754,13 @@ bool CGUIMediaWindow::Update(const CStdString &strDirectory) if (items.GetLabel().IsEmpty()) items.SetLabel(CUtil::GetTitleFromPath(items.GetPath(), true)); - - ClearFileItems(); - m_vecItems->Copy(items); - + + ClearFileItems(refresh); + if (refresh) + m_vecItems->Append(items); + else + m_vecItems->Copy(items); + // if we're getting the root source listing // make sure the path history is clean if (strDirectory.IsEmpty()) diff --git a/xbmc/windows/GUIMediaWindow.h b/xbmc/windows/GUIMediaWindow.h index 67abce23d3..765a48fc43 100644 --- a/xbmc/windows/GUIMediaWindow.h +++ b/xbmc/windows/GUIMediaWindow.h @@ -80,7 +80,7 @@ protected: virtual void OnPrepareFileItems(CFileItemList &items); virtual void OnFinalizeFileItems(CFileItemList &items); - void ClearFileItems(); + void ClearFileItems(bool itemsOnly = false); virtual void SortItems(CFileItemList &items); virtual bool CheckFilterAdvanced(CFileItemList &items) { return false; } |