Mercurial > hg > orthanc-databases
comparison Framework/Plugins/PluginInitialization.cpp @ 64:e39c1ebb7a0e
fix in backwards compatibility
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 14 Dec 2018 12:43:15 +0100 |
parents | eedd082355f9 |
children | 714c5d2bee76 |
comparison
equal
deleted
inserted
replaced
63:ffaa97a2c83a | 64:e39c1ebb7a0e |
---|---|
22 #include "PluginInitialization.h" | 22 #include "PluginInitialization.h" |
23 | 23 |
24 #include "../Common/ImplicitTransaction.h" | 24 #include "../Common/ImplicitTransaction.h" |
25 | 25 |
26 #include <Core/Logging.h> | 26 #include <Core/Logging.h> |
27 #include <Core/Toolbox.h> | |
27 #include <Plugins/Samples/Common/OrthancPluginCppWrapper.h> | 28 #include <Plugins/Samples/Common/OrthancPluginCppWrapper.h> |
28 | 29 |
29 | 30 |
30 namespace OrthancDatabases | 31 namespace OrthancDatabases |
31 { | 32 { |
84 << ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER | 85 << ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER |
85 << " to run this plugin"; | 86 << " to run this plugin"; |
86 return false; | 87 return false; |
87 } | 88 } |
88 | 89 |
90 if (useFallback) | |
91 { | |
92 std::string v(context->orthancVersion); | |
93 | |
94 if (v == "mainline") | |
95 { | |
96 isOptimal = true; | |
97 } | |
98 else | |
99 { | |
100 std::vector<std::string> tokens; | |
101 Orthanc::Toolbox::TokenizeString(tokens, v, '.'); | |
102 | |
103 if (tokens.size() != 3) | |
104 { | |
105 LOG(ERROR) << "Bad version of Orthanc: " << v; | |
106 return false; | |
107 } | |
108 | |
109 int major = boost::lexical_cast<int>(tokens[0]); | |
110 int minor = boost::lexical_cast<int>(tokens[1]); | |
111 int revision = boost::lexical_cast<int>(tokens[2]); | |
112 | |
113 isOptimal = (major > 1 || | |
114 (major == 1 && minor > 4) || | |
115 (major == 1 && minor == 4 && revision >= 0)); | |
116 } | |
117 } | |
118 | |
89 if (!isOptimal && | 119 if (!isOptimal && |
90 isIndex) | 120 isIndex) |
91 { | 121 { |
92 LOG(WARNING) << "Performance warning in " << dbms | 122 LOG(WARNING) << "Performance warning in " << dbms |
93 << " index: Your version of Orthanc (" | 123 << " index: Your version of Orthanc (" |