diff Applications/StoneWebViewer/Plugin/Plugin.cpp @ 2177:4d21befb1501 default tip

clarify DICOMweb version check
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Oct 2024 19:27:56 +0200
parents c4df20981eb1
children
line wrap: on
line diff
--- a/Applications/StoneWebViewer/Plugin/Plugin.cpp	Tue Oct 22 21:59:25 2024 +0200
+++ b/Applications/StoneWebViewer/Plugin/Plugin.cpp	Wed Oct 23 19:27:56 2024 +0200
@@ -28,6 +28,8 @@
 #include <SystemToolbox.h>
 #include <Toolbox.h>
 
+#include <boost/algorithm/string/predicate.hpp>
+
 
 static const std::string STONE_WEB_VIEWER_ROOT = "/stone-webviewer";  // (*)
 static const char* CONFIG_SECTION = "StoneWebViewer";
@@ -61,7 +63,8 @@
       }
 
       std::string version = info["Version"].asString();
-      if (version.find("mainline") != 0)
+      if (version == "mainline" ||
+          boost::starts_with(version, "mainline-"))  // Allow DICOMweb versions such as "mainline-commitId"
       {
         std::vector<std::string> tokens;
         Orthanc::Toolbox::TokenizeString(tokens, version, '.');