Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allow addons with no extensions to be returned for dependency checking

  • Loading branch information...
commit 46bdb1750510a74c54fd27a9d97c873b154c3196 1 parent ca950ee
Jonathan Marshall authored
View
23 xbmc/addons/Addon.cpp
@@ -273,6 +273,17 @@ AddonProps::AddonProps(const cp_extension_t *ext)
BuildDependencies(ext->plugin);
}
+AddonProps::AddonProps(const cp_plugin_info_t *plugin)
+ : id(plugin->identifier)
+ , version(plugin->version)
+ , name(plugin->name)
+ , path(plugin->plugin_path)
+ , author(plugin->provider_name)
+ , stars(0)
+{
+ BuildDependencies(plugin);
+}
+
void AddonProps::BuildDependencies(const cp_plugin_info_t *plugin)
{
if (!plugin)
@@ -304,6 +315,18 @@ CAddon::CAddon(const cp_extension_t *ext)
m_userSettingsLoaded = false;
}
+CAddon::CAddon(const cp_plugin_info_t *plugin)
+ : m_props(plugin)
+ , m_parent(AddonPtr())
+{
+ m_enabled = true;
+ m_hasSettings = false;
+ m_hasStrings = false;
+ m_checkedStrings = true;
+ m_settingsLoaded = false;
+ m_userSettingsLoaded = false;
+}
+
CAddon::CAddon(const AddonProps &props)
: m_props(props)
, m_parent(AddonPtr())
View
2  xbmc/addons/Addon.h
@@ -71,6 +71,7 @@ class AddonProps
}
AddonProps(const cp_extension_t *ext);
+ AddonProps(const cp_plugin_info_t *plugin);
bool operator==(const AddonProps &rhs)
{
@@ -110,6 +111,7 @@ class CAddon : public IAddon
public:
CAddon(const AddonProps &addonprops);
CAddon(const cp_extension_t *ext);
+ CAddon(const cp_plugin_info_t *plugin);
virtual ~CAddon() {}
virtual AddonPtr Clone(const AddonPtr& parent) const;
View
7 xbmc/addons/AddonManager.cpp
@@ -624,9 +624,14 @@ bool CAddonMgr::GetExtList(cp_cfg_element_t *base, const char *path, vector<CStd
AddonPtr CAddonMgr::GetAddonFromDescriptor(const cp_plugin_info_t *info)
{
- if (!info || !info->extensions)
+ if (!info)
return AddonPtr();
+ if (!info->extensions)
+ { // no extensions, so we need only the dep information
+ return AddonPtr(new CAddon(info));
+ }
+
// FIXME: If we want to support multiple extension points per addon, we'll need to extend this to not just take
// the first extension point (eg use the TYPE information we pass in)
Please sign in to comment.
Something went wrong with that request. Please try again.