[addons] fix: only prompt if the add-on is a compulsory dependency on uninstall/disable
authorJonathan Marshall <jmarshall@xbmc.org>
Sat, 9 Nov 2013 01:21:59 +0000 (14:21 +1300)
committerJonathan Marshall <jmarshall@xbmc.org>
Mon, 11 Nov 2013 07:37:41 +0000 (20:37 +1300)
xbmc/addons/GUIDialogAddonInfo.cpp

index 75f07ec..c2de531 100644 (file)
@@ -192,11 +192,12 @@ bool CGUIDialogAddonInfo::PromptIfDependency(int heading, int line2)
   for (VECADDONS::iterator it  = addons.begin();
                            it != addons.end();++it)
   {
-    if ((*it)->GetDeps().find(m_localAddon->ID()) != (*it)->GetDeps().end())
+    ADDONDEPS::const_iterator i = (*it)->GetDeps().find(m_localAddon->ID());
+    if (i != (*it)->GetDeps().end() && !i->second.second) // non-optional dependency
       deps.push_back((*it)->Name());
   }
 
-  if (!CAddonInstaller::Get().CheckDependencies(m_localAddon) && deps.size())
+  if (!deps.empty())
   {
     CStdString strLine0, strLine1;
     StringUtils::JoinString(deps, ", ", strLine1);