Permalink
Browse files

switch from an index to the path for storing the current item in medi…

…a windows
  • Loading branch information...
1 parent 625736a commit 255aba03273974d15a405acd969a95b997b26066 Jonathan Marshall committed May 18, 2012
Showing with 8 additions and 7 deletions.
  1. +2 −1 xbmc/pictures/GUIWindowPictures.cpp
  2. +5 −5 xbmc/windows/GUIMediaWindow.cpp
  3. +1 −1 xbmc/windows/GUIMediaWindow.h
@@ -76,7 +76,8 @@ void CGUIWindowPictures::OnInitWindow()
{
if (wndw && wndw->GetCurrentSlide())
m_viewControl.SetSelectedItem(wndw->GetCurrentSlide()->GetPath());
- m_iSelectedItem = m_viewControl.GetSelectedItem();
+ if (m_viewControl.GetSelectedItem() >= 0)
+ m_selectedItem = m_vecItems->Get(m_viewControl.GetSelectedItem())->GetPath();
}
m_slideShowStarted = false;
}
@@ -80,7 +80,6 @@ CGUIMediaWindow::CGUIMediaWindow(int id, const char *xmlFile)
m_unfilteredItems = new CFileItemList;
m_vecItems->SetPath("?");
m_iLastControl = -1;
- m_iSelectedItem = -1;
m_guiState.reset(CGUIViewState::GetViewState(GetID(), *m_vecItems));
}
@@ -214,7 +213,8 @@ bool CGUIMediaWindow::OnMessage(CGUIMessage& message)
{
case GUI_MSG_WINDOW_DEINIT:
{
- m_iSelectedItem = m_viewControl.GetSelectedItem();
+ if (m_viewControl.GetSelectedItem() >= 0)
+ m_selectedItem = m_vecItems->Get(m_viewControl.GetSelectedItem())->GetPath();
m_iLastControl = GetFocusedControlID();
CGUIWindow::OnMessage(message);
CGUIDialogContextMenu* pDlg = (CGUIDialogContextMenu*)g_windowManager.GetWindow(WINDOW_DIALOG_CONTEXT_MENU);
@@ -950,7 +950,8 @@ bool CGUIMediaWindow::OnClick(int iItem)
}
else
{
- m_iSelectedItem = m_viewControl.GetSelectedItem();
+ if (m_viewControl.GetSelectedItem() >= 0)
+ m_selectedItem = m_vecItems->Get(m_viewControl.GetSelectedItem())->GetPath();
if (pItem->GetPath() == "newplaylist://")
{
@@ -1349,8 +1350,7 @@ void CGUIMediaWindow::OnInitWindow()
Update(m_vecItems->GetPath());
m_rootDir.SetAllowThreads(true);
- if (m_iSelectedItem > -1)
- m_viewControl.SetSelectedItem(m_iSelectedItem);
+ m_viewControl.SetSelectedItem(m_selectedItem);
CGUIWindow::OnInitWindow();
}
@@ -120,6 +120,6 @@ class CGUIMediaWindow : public CGUIWindow
// save control state on window exit
int m_iLastControl;
- int m_iSelectedItem;
+ CStdString m_selectedItem;
CStdString m_startDirectory;
};

0 comments on commit 255aba0

Please sign in to comment.