Mercurial > hg > orthanc-databases
changeset 64:e39c1ebb7a0e
fix in backwards compatibility
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 14 Dec 2018 12:43:15 +0100 |
parents | ffaa97a2c83a |
children | aa2e27f77cc8 |
files | Framework/Plugins/PluginInitialization.cpp |
diffstat | 1 files changed, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Framework/Plugins/PluginInitialization.cpp Wed Dec 05 08:57:46 2018 +0100 +++ b/Framework/Plugins/PluginInitialization.cpp Fri Dec 14 12:43:15 2018 +0100 @@ -24,6 +24,7 @@ #include "../Common/ImplicitTransaction.h" #include <Core/Logging.h> +#include <Core/Toolbox.h> #include <Plugins/Samples/Common/OrthancPluginCppWrapper.h> @@ -86,6 +87,35 @@ return false; } + if (useFallback) + { + std::string v(context->orthancVersion); + + if (v == "mainline") + { + isOptimal = true; + } + else + { + std::vector<std::string> tokens; + Orthanc::Toolbox::TokenizeString(tokens, v, '.'); + + if (tokens.size() != 3) + { + LOG(ERROR) << "Bad version of Orthanc: " << v; + return false; + } + + int major = boost::lexical_cast<int>(tokens[0]); + int minor = boost::lexical_cast<int>(tokens[1]); + int revision = boost::lexical_cast<int>(tokens[2]); + + isOptimal = (major > 1 || + (major == 1 && minor > 4) || + (major == 1 && minor == 4 && revision >= 0)); + } + } + if (!isOptimal && isIndex) {