Permalink
Browse files

[gui] static content in lists didn't correctly take into account hidd…

…en items when determining which item to focus by default
  • Loading branch information...
1 parent 650829f commit 0c58c2fe78cbad85301b74905dba089f5750c520 Jonathan Marshall committed Jan 23, 2014
Showing with 7 additions and 2 deletions.
  1. +7 −2 xbmc/listproviders/StaticProvider.cpp
@@ -100,10 +100,15 @@ int CStaticListProvider::GetDefaultItem() const
{
if (m_defaultItem >= 0)
{
+ unsigned int offset = 0;
for (vector<CGUIStaticItemPtr>::const_iterator i = m_items.begin(); i != m_items.end(); ++i)
{
- if ((*i)->m_iprogramCount == m_defaultItem && (*i)->IsVisible())
- return i - m_items.begin();
+ if ((*i)->IsVisible())
+ {
+ if ((*i)->m_iprogramCount == m_defaultItem && (*i)->IsVisible())
+ return offset;
+ offset++;
+ }
}
}
return -1;

0 comments on commit 0c58c2f

Please sign in to comment.