Skip to content

Commit

Permalink
fixed: do not query the addon state when asking the guiinfomanager fo…
Browse files Browse the repository at this point in the history
…r addon title and/or icon

This commit removes tons of useless queries made from the mainloop when using addon shortcuts on
the home screen. As the infomanager is asked for the icon or title only, it's not needed to check
whether the addon is enabled or disabled all the time.
  • Loading branch information
mkortstiege authored and Montellese committed Jul 7, 2012
1 parent 30e9f45 commit 5c10498
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xbmc/GUIInfoManager.cpp
Expand Up @@ -2824,11 +2824,15 @@ CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWi
else if (info.m_info == SYSTEM_ADDON_TITLE ||
info.m_info == SYSTEM_ADDON_ICON)
{
// This logic does not check/care whether an addon has been disabled/marked as broken,
// it simply retrieves it's name or icon that means if an addon is placed on the home screen it
// will stay there even if it's disabled/marked as broken. This might need to be changed/fixed
// in the future.
AddonPtr addon;
if (info.GetData2() == 0)
CAddonMgr::Get().GetAddon(const_cast<CGUIInfoManager*>(this)->GetLabel(info.GetData1(), contextWindow),addon);
CAddonMgr::Get().GetAddon(const_cast<CGUIInfoManager*>(this)->GetLabel(info.GetData1(), contextWindow),addon,ADDON_UNKNOWN,false);
else
CAddonMgr::Get().GetAddon(m_stringParameters[info.GetData1()],addon);
CAddonMgr::Get().GetAddon(m_stringParameters[info.GetData1()],addon,ADDON_UNKNOWN,false);
if (addon && info.m_info == SYSTEM_ADDON_TITLE)
return addon->Name();
if (addon && info.m_info == SYSTEM_ADDON_ICON)
Expand Down

0 comments on commit 5c10498

Please sign in to comment.