# HG changeset patch
# User Sebastien Jodogne <s.jodogne@gmail.com>
# Date 1711119545 -3600
# Node ID 0bbb4e12b1f06180de2cfb5a925a2247cd4ee102
# Parent  4ff1471ebe8bed1f7c1fe89038e82816d9146a5b
fix deprecated call

diff -r 4ff1471ebe8b -r 0bbb4e12b1f0 Plugin/Plugin.cpp
--- a/Plugin/Plugin.cpp	Fri Jan 05 17:36:06 2024 +0100
+++ b/Plugin/Plugin.cpp	Fri Mar 22 15:59:05 2024 +0100
@@ -47,6 +47,9 @@
 
 #include "Mutex.h"
 
+#define ORTHANC_PLUGIN_NAME  "java"
+
+
 OrthancPluginContext* context_ = NULL;
 
 static std::unique_ptr<JavaVirtualMachine> java_;
@@ -417,6 +420,21 @@
 }
 
 
+static void SetPluginDescription(const std::string& description)
+{
+#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4)
+  OrthancPluginSetDescription2(context_, ORTHANC_PLUGIN_NAME, description.c_str());
+#else
+  _OrthancPluginSetPluginProperty params;
+  params.plugin = ORTHANC_PLUGIN_NAME;
+  params.property = _OrthancPluginProperty_Description;
+  params.value = description.c_str();
+
+  context_->InvokeService(context_, _OrthancPluginService_SetPluginProperty, &params);
+#endif
+}
+
+
 extern "C"
 {
   ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
@@ -436,7 +454,7 @@
       return -1;
     }
 
-    OrthancPluginSetDescription(context, "Java plugin for Orthanc");
+    SetPluginDescription("Java plugin for Orthanc");
 
     try
     {
@@ -546,7 +564,7 @@
 
   ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
   {
-    return "java";
+    return ORTHANC_PLUGIN_NAME;
   }
 
 
diff -r 4ff1471ebe8b -r 0bbb4e12b1f0 Resources/Orthanc/CMake/JsonCppConfiguration.cmake
--- a/Resources/Orthanc/CMake/JsonCppConfiguration.cmake	Fri Jan 05 17:36:06 2024 +0100
+++ b/Resources/Orthanc/CMake/JsonCppConfiguration.cmake	Fri Mar 22 15:59:05 2024 +0100
@@ -28,9 +28,9 @@
     set(JSONCPP_MD5 "3a8072ca6a1fa9cbaf7715ae625f134f")
     add_definitions(-DORTHANC_LEGACY_JSONCPP=1)
   else()
-    set(JSONCPP_SOURCES_DIR ${CMAKE_BINARY_DIR}/jsoncpp-1.9.4)
-    set(JSONCPP_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/jsoncpp-1.9.4.tar.gz")
-    set(JSONCPP_MD5 "4757b26ec89798c5247fa638edfdc446")
+    set(JSONCPP_SOURCES_DIR ${CMAKE_BINARY_DIR}/jsoncpp-1.9.5)
+    set(JSONCPP_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/jsoncpp-1.9.5.tar.gz")
+    set(JSONCPP_MD5 "d6c8c609f2162eff373db62b90a051c7")
     add_definitions(-DORTHANC_LEGACY_JSONCPP=0)
     set(JSONCPP_CXX11 ON)
   endif()