comparison RenderingPlugin/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp @ 2119:11bc8a304038

fix deprecated calls
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 16 Mar 2024 12:04:50 +0100
parents c23eef785569
children 16c01cc201e7
comparison
equal deleted inserted replaced
2118:7926c9a09757 2119:11bc8a304038
4024 for (uint32_t i = 0; i < request->headersCount; ++i) 4024 for (uint32_t i = 0; i < request->headersCount; ++i)
4025 { 4025 {
4026 result[request->headersKeys[i]] = request->headersValues[i]; 4026 result[request->headersKeys[i]] = request->headersValues[i];
4027 } 4027 }
4028 } 4028 }
4029
4030 #if !ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4)
4031 static void SetPluginProperty(const std::string& pluginIdentifier,
4032 _OrthancPluginProperty property,
4033 const std::string& value)
4034 {
4035 _OrthancPluginSetPluginProperty params;
4036 params.plugin = pluginIdentifier.c_str();
4037 params.property = property;
4038 params.value = value.c_str();
4039
4040 GetGlobalContext()->InvokeService(GetGlobalContext(), _OrthancPluginService_SetPluginProperty, &params);
4041 }
4042 #endif
4043
4044 void SetRootUri(const std::string& pluginIdentifier,
4045 const std::string& uri)
4046 {
4047 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4)
4048 OrthancPluginSetRootUri2(GetGlobalContext(), pluginIdentifier.c_str(), uri.c_str());
4049 #else
4050 SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_RootUri, uri);
4051 #endif
4052 }
4053
4054 void SetDescription(const std::string& pluginIdentifier,
4055 const std::string& description)
4056 {
4057 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4)
4058 OrthancPluginSetDescription2(GetGlobalContext(), pluginIdentifier.c_str(), description.c_str());
4059 #else
4060 SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_Description, description);
4061 #endif
4062 }
4063
4064 void ExtendOrthancExplorer(const std::string& pluginIdentifier,
4065 const std::string& javascript)
4066 {
4067 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4)
4068 OrthancPluginExtendOrthancExplorer2(GetGlobalContext(), pluginIdentifier.c_str(), javascript.c_str());
4069 #else
4070 SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_OrthancExplorer, javascript);
4071 #endif
4072 }
4029 } 4073 }