Permalink
Browse files

Merge pull request #2007 from jmarshallnz/dot_dot_dot

Show '..' items as we're supposed to in empty lists
  • Loading branch information...
2 parents 8d822b5 + ede31b2 commit a1d90c159c3e642d256605c220fafbad28de64b1 @jmarshallnz jmarshallnz committed Dec 30, 2012
Showing with 13 additions and 26 deletions.
  1. +13 −26 xbmc/windows/GUIMediaWindow.cpp
@@ -873,18 +873,6 @@ bool CGUIMediaWindow::Update(const CStdString &strDirectory, bool updateFilterPa
// filtering on the items, setting thumbs.
OnPrepareFileItems(*m_vecItems);
- // The idea here is to ensure we have something to focus if our file list
- // is empty. As such, this check MUST be last and ignore the hide parent
- // fileitems settings.
- if (m_vecItems->IsEmpty())
- {
- CFileItemPtr pItem(new CFileItem(".."));
- pItem->SetPath(m_history.GetParentPath());
- pItem->m_bIsFolder = true;
- pItem->m_bIsShareOrDrive = false;
- m_vecItems->AddFront(pItem, 0);
- }
-
m_vecItems->FillInDefaultIcons();
m_guiState.reset(CGUIViewState::GetViewState(GetID(), *m_vecItems));
@@ -946,22 +934,9 @@ bool CGUIMediaWindow::Refresh(bool clearCache /* = false */)
m_vecItems->RemoveDiscCache(GetID());
// get the original number of items
- int oldCount = m_filter.IsEmpty() ? m_vecItems->Size() : m_unfilteredItems->Size();
if (!Update(strCurrentDirectory, false))
return false;
- // check if we previously had at least 1 item
- // in the list and whether it now went down to 0
- // if there are no more items to show after the update
- // we go one level up in the hierachry to not show an
- // empty list
- if (oldCount > 0 &&
- (m_filter.IsEmpty() ? m_vecItems->Size() : m_unfilteredItems->Size()) <= 0)
- {
- CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, g_localizeStrings.Get(2080), g_localizeStrings.Get(2081));
- GoParentFolder();
- }
-
return true;
}
@@ -1775,7 +1750,19 @@ void CGUIMediaWindow::OnFilterItems(const CStdString &filter)
}
}
}
-
+
+ // The idea here is to ensure we have something to focus if our file list
+ // is empty. As such, this check MUST be last and ignore the hide parent
+ // fileitems settings.
+ if (m_vecItems->IsEmpty())
+ {
+ CFileItemPtr pItem(new CFileItem(".."));
+ pItem->SetPath(m_history.GetParentPath());
+ pItem->m_bIsFolder = true;
+ pItem->m_bIsShareOrDrive = false;
+ m_vecItems->AddFront(pItem, 0);
+ }
+
// and update our view control + buttons
m_viewControl.SetItems(*m_vecItems);
m_viewControl.SetSelectedItem(currentItemPath);

0 comments on commit a1d90c1

Please sign in to comment.