diff options
author | Martijn Kaijser <machine.sanctum@gmail.com> | 2012-12-06 14:13:00 -0800 |
---|---|---|
committer | Martijn Kaijser <machine.sanctum@gmail.com> | 2012-12-06 14:13:00 -0800 |
commit | 08666e76950719918a2636071eb6aa7c840130e9 (patch) | |
tree | f10c1a5b8b7f5c181700bac8f9643c231f6aa57f | |
parent | d78d85ec857faac1b17abe7c04ff1e1000615b0e (diff) | |
parent | e2e8068db9f770731d78dee7e472455f4945c8be (diff) |
Merge pull request #1879 from Montellese/addons_extpoint_minversion
addons: use the extension-point's version if no minversion (i.e. no <backwards-compatibility> tag) is specified when checking imported extension-points
-rw-r--r-- | xbmc/addons/Addon.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xbmc/addons/Addon.cpp b/xbmc/addons/Addon.cpp index 9fbbf12836..79d69bcf77 100644 --- a/xbmc/addons/Addon.cpp +++ b/xbmc/addons/Addon.cpp @@ -32,6 +32,7 @@ #include "freebsd/FreeBSDGNUReplacements.h" #endif #include "utils/log.h" +#include "utils/StringUtils.h" #include "utils/URIUtils.h" #include "URL.h" #include <vector> @@ -313,6 +314,13 @@ AddonPtr CAddon::Clone(const AddonPtr &self) const bool CAddon::MeetsVersion(const AddonVersion &version) const { + // if the addon is one of xbmc's extension point definitions (addonid starts with "xbmc.") + // and the minversion is "0.0.0" i.e. no <backwards-compatibility> tag has been specified + // we need to assume that the current version is not backwards-compatible and therefore check against the actual version + if (StringUtils::StartsWith(m_props.id, "xbmc.") && + (strlen(m_props.minversion.c_str()) == 0 || StringUtils::EqualsNoCase(m_props.minversion.c_str(), "0.0.0"))) + return m_props.version == version; + return m_props.minversion <= version && version <= m_props.version; } |