diff options
author | montellese <montellese@xbmc.org> | 2012-12-02 13:00:21 +0100 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2012-12-04 10:32:59 +0100 |
commit | e2e8068db9f770731d78dee7e472455f4945c8be (patch) | |
tree | 40702504cdb29b448bdad9ff05a09a5b6310435b | |
parent | 192701b6a1cde82106c287c5f1a6ee07c4388567 (diff) |
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; } |