Skip to content

Commit

Permalink
Cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Black09 committed Feb 25, 2014
1 parent 1da515f commit 6c22dd5
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
8 changes: 5 additions & 3 deletions xbmc/guilib/GUIBaseContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,11 @@ void CGUIBaseContainer::AllocResources()
{
CGUIControl::AllocResources();
CalculateLayout();
UpdateListProvider(true);
if (m_listProvider)
{
UpdateListProvider(true);
SelectItem(m_listProvider->GetDefaultItem());
}
}

void CGUIBaseContainer::FreeResources(bool immediately)
Expand Down Expand Up @@ -869,11 +871,11 @@ void CGUIBaseContainer::UpdateVisibility(const CGUIListItem *item)
UpdateListProvider();
}

void CGUIBaseContainer::UpdateListProvider(bool refreshItems)
void CGUIBaseContainer::UpdateListProvider(bool forceRefresh /* = false */)
{
if (m_listProvider)
{
if (m_listProvider->Update(refreshItems))
if (m_listProvider->Update(forceRefresh))
{
// save the current item
int currentItem = GetSelectedItem();
Expand Down
2 changes: 1 addition & 1 deletion xbmc/guilib/GUIBaseContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class CGUIBaseContainer : public IGUIContainer
virtual int GetCurrentPage() const;
bool InsideLayout(const CGUIListItemLayout *layout, const CPoint &point) const;
virtual void OnFocus();
void UpdateListProvider(bool refreshItems = false);
void UpdateListProvider(bool forceRefresh = false);

int ScrollCorrectionRange() const;
inline float Size() const;
Expand Down
5 changes: 2 additions & 3 deletions xbmc/listproviders/DirectoryProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CDirectoryJob : public CJob
initThumbLoader<CProgramThumbLoader>(PROGRAM);
return m_thumbloaders[PROGRAM];
}

template<class CThumbLoaderClass>
void initThumbLoader(InfoTagType type)
{
Expand Down Expand Up @@ -141,7 +141,6 @@ CDirectoryProvider::CDirectoryProvider(const TiXmlElement *element, int parentID
m_jobID(0)
{
assert(element);

if (!element->NoChildren())
{
const char *target = element->Attribute("target");
Expand All @@ -156,7 +155,7 @@ CDirectoryProvider::~CDirectoryProvider()
Reset(true);
}

bool CDirectoryProvider::Update(bool refresh)
bool CDirectoryProvider::Update(bool forceRefresh)
{
// we never need to force refresh here
bool changed = false;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/listproviders/DirectoryProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CDirectoryProvider :
CDirectoryProvider(const TiXmlElement *element, int parentID);
virtual ~CDirectoryProvider();

virtual bool Update(bool refresh);
virtual bool Update(bool forceRefresh);
virtual void Announce(ANNOUNCEMENT::AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data);
virtual void Fetch(std::vector<CGUIListItemPtr> &items) const;
virtual void Reset(bool immediately = false);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/listproviders/IListProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class IListProvider
/*! \brief Update the list content
\return true if the content has changed, false otherwise.
*/
virtual bool Update(bool refresh)=0;
virtual bool Update(bool forceRefresh)=0;

/*! \brief Fetch the current list of items.
\param items [out] the list to be filled.
Expand Down
4 changes: 2 additions & 2 deletions xbmc/listproviders/StaticProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ CStaticListProvider::~CStaticListProvider()
{
}

bool CStaticListProvider::Update(bool refresh)
bool CStaticListProvider::Update(bool forceRefresh)
{
bool changed = refresh;
bool changed = forceRefresh;
if (!m_updateTime)
m_updateTime = CTimeUtils::GetFrameTime();
else if (CTimeUtils::GetFrameTime() - m_updateTime > 1000)
Expand Down
2 changes: 1 addition & 1 deletion xbmc/listproviders/StaticProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CStaticListProvider : public IListProvider
CStaticListProvider(const std::vector<CGUIStaticItemPtr> &items); // for python
virtual ~CStaticListProvider();

virtual bool Update(bool refresh);
virtual bool Update(bool forceRefresh);
virtual void Fetch(std::vector<CGUIListItemPtr> &items) const;
virtual bool OnClick(const CGUIListItemPtr &item);
virtual void SetDefaultItem(int item, bool always);
Expand Down

0 comments on commit 6c22dd5

Please sign in to comment.