aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <martijn@xbmc.org>2018-12-28 10:56:01 +0100
committerGitHub <noreply@github.com>2018-12-28 10:56:01 +0100
commit1dd1b12d1581833db9a08a2f7ac9ab01ece9e04a (patch)
tree22a0bfdcaa89ac946c3d742b16bd6d2c905132e4
parent94184731d2bb21f98d5964a268e18cc2a04ffb9d (diff)
parentbe46ffdc2c99379da09ae6857e67b8aea8031864 (diff)
Merge pull request #15099 from xbmc/addon-install-info
Do not list non-repo add-ons as "unavailable" in info dialog
-rw-r--r--xbmc/addons/GUIDialogAddonInfo.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/xbmc/addons/GUIDialogAddonInfo.cpp b/xbmc/addons/GUIDialogAddonInfo.cpp
index 00c44ec16c..fceabd9201 100644
--- a/xbmc/addons/GUIDialogAddonInfo.cpp
+++ b/xbmc/addons/GUIDialogAddonInfo.cpp
@@ -471,12 +471,21 @@ bool CGUIDialogAddonInfo::ShowDependencyList(const std::vector<ADDON::Dependency
CFileItemList items;
for (auto& it : deps)
{
- AddonPtr dep_addon, local_addon;
+ AddonPtr dep_addon, local_addon, info_addon;
+ // Find add-on in repositories
CServiceBroker::GetAddonMgr().FindInstallableById(it.id, dep_addon);
+ // Find add-on in local installation
CServiceBroker::GetAddonMgr().GetAddon(it.id, local_addon);
- if (dep_addon)
+
+ // All combinations of dep_addon and local_addon validity are possible and information
+ // must be displayed even when there is no dep_addon.
+ // info_addon is the add-on to take the information to display (name, icon) from. The
+ // version in the repository is preferred because it might contain more recent data.
+ info_addon = dep_addon ? dep_addon : local_addon;
+
+ if (info_addon)
{
- CFileItemPtr item(new CFileItem(dep_addon->Name()));
+ CFileItemPtr item(new CFileItem(info_addon->Name()));
std::stringstream str;
str << it.id << " " << it.requiredVersion.asString();
if ((it.optional && !local_addon) || (!it.optional && local_addon))
@@ -489,7 +498,7 @@ bool CGUIDialogAddonInfo::ShowDependencyList(const std::vector<ADDON::Dependency
g_localizeStrings.Get(39018).c_str());
item->SetLabel2(str.str());
- item->SetIconImage(dep_addon->Icon());
+ item->SetIconImage(info_addon->Icon());
item->SetProperty("addon_id", it.id);
items.Add(item);
}