fixed: do not query the addon state when asking the guiinfomanager for addon title...
authorvdrfan <vdrfan-nospam-@xbmc.org>
Sun, 17 Jun 2012 10:54:50 +0000 (12:54 +0200)
committermontellese <montellese@xbmc.org>
Sat, 7 Jul 2012 07:36:24 +0000 (09:36 +0200)
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.

xbmc/GUIInfoManager.cpp

index cd044d4..c2b94a3 100644 (file)
@@ -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)