changeset 492:af6998ed73dd

fix deprecated calls
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 Mar 2024 15:03:26 +0100
parents 711b136e8fe8
children 0a8168522165
files Framework/Plugins/PluginInitialization.cpp Framework/Plugins/PluginInitialization.h MySQL/Plugins/IndexPlugin.cpp MySQL/Plugins/StoragePlugin.cpp Odbc/Plugins/IndexPlugin.cpp Odbc/Plugins/StoragePlugin.cpp PostgreSQL/Plugins/IndexPlugin.cpp PostgreSQL/Plugins/StoragePlugin.cpp SQLite/Plugins/IndexPlugin.cpp
diffstat 9 files changed, 31 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Plugins/PluginInitialization.cpp	Fri Mar 22 14:42:36 2024 +0100
+++ b/Framework/Plugins/PluginInitialization.cpp	Fri Mar 22 15:03:26 2024 +0100
@@ -43,6 +43,7 @@
 
 
   bool InitializePlugin(OrthancPluginContext* context,
+                        const std::string& pluginName,
                         const std::string& dbms,
                         bool isIndex)
   {
@@ -151,7 +152,7 @@
                                std::string(isIndex ? "index" : "storage area") +
                                " into a " + dbms + " database");
     
-    OrthancPluginSetDescription(context, description.c_str());
+    OrthancPlugins::SetDescription(pluginName, description.c_str());
 
     return true;
   }
--- a/Framework/Plugins/PluginInitialization.h	Fri Mar 22 14:42:36 2024 +0100
+++ b/Framework/Plugins/PluginInitialization.h	Fri Mar 22 15:03:26 2024 +0100
@@ -29,6 +29,7 @@
 namespace OrthancDatabases
 {
   bool InitializePlugin(OrthancPluginContext* context,
+                        const std::string& pluginName,
                         const std::string& dbms,
                         bool isIndex);
 }
--- a/MySQL/Plugins/IndexPlugin.cpp	Fri Mar 22 14:42:36 2024 +0100
+++ b/MySQL/Plugins/IndexPlugin.cpp	Fri Mar 22 15:03:26 2024 +0100
@@ -30,6 +30,7 @@
 
 #include <google/protobuf/any.h>
 
+#define ORTHANC_PLUGIN_NAME "mysql-index"
 
 extern "C"
 {
@@ -37,7 +38,7 @@
   {
     GOOGLE_PROTOBUF_VERIFY_VERSION;
 
-    if (!OrthancDatabases::InitializePlugin(context, "MySQL", true))
+    if (!OrthancDatabases::InitializePlugin(context, ORTHANC_PLUGIN_NAME, "MySQL", true))
     {
       return -1;
     }
@@ -103,7 +104,7 @@
 
   ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
   {
-    return "mysql-index";
+    return ORTHANC_PLUGIN_NAME;
   }
 
 
--- a/MySQL/Plugins/StoragePlugin.cpp	Fri Mar 22 14:42:36 2024 +0100
+++ b/MySQL/Plugins/StoragePlugin.cpp	Fri Mar 22 15:03:26 2024 +0100
@@ -28,12 +28,14 @@
 #include <Logging.h>
 #include <Toolbox.h>
 
+#define ORTHANC_PLUGIN_NAME "mysql-storage"
+
 
 extern "C"
 {
   ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
   {
-    if (!OrthancDatabases::InitializePlugin(context, "MySQL", false))
+    if (!OrthancDatabases::InitializePlugin(context, ORTHANC_PLUGIN_NAME, "MySQL", false))
     {
       return -1;
     }
@@ -95,7 +97,7 @@
 
   ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
   {
-    return "mysql-storage";
+    return ORTHANC_PLUGIN_NAME;
   }
 
 
--- a/Odbc/Plugins/IndexPlugin.cpp	Fri Mar 22 14:42:36 2024 +0100
+++ b/Odbc/Plugins/IndexPlugin.cpp	Fri Mar 22 15:03:26 2024 +0100
@@ -28,6 +28,8 @@
 
 #include <Logging.h>
 
+#define ORTHANC_PLUGIN_NAME "odbc-index"
+
 
 #if defined(_WIN32)
 #  ifdef _MSC_VER
@@ -59,7 +61,7 @@
   {
     GOOGLE_PROTOBUF_VERIFY_VERSION;
 
-    if (!OrthancDatabases::InitializePlugin(context, "ODBC", true))
+    if (!OrthancDatabases::InitializePlugin(context, ORTHANC_PLUGIN_NAME, "ODBC", true))
     {
       return -1;
     }
@@ -141,7 +143,7 @@
 
   ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
   {
-    return "odbc-index";
+    return ORTHANC_PLUGIN_NAME;
   }
 
 
--- a/Odbc/Plugins/StoragePlugin.cpp	Fri Mar 22 14:42:36 2024 +0100
+++ b/Odbc/Plugins/StoragePlugin.cpp	Fri Mar 22 15:03:26 2024 +0100
@@ -29,6 +29,8 @@
 
 #include <Logging.h>
 
+#define ORTHANC_PLUGIN_NAME "odbc-storage"
+
 
 namespace OrthancDatabases
 {
@@ -113,7 +115,7 @@
   
   ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
   {
-    if (!OrthancDatabases::InitializePlugin(context, "ODBC", false))
+    if (!OrthancDatabases::InitializePlugin(context, ORTHANC_PLUGIN_NAME, "ODBC", false))
     {
       return -1;
     }
@@ -191,7 +193,7 @@
 
   ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
   {
-    return "odbc-storage";
+    return ORTHANC_PLUGIN_NAME;
   }
 
 
--- a/PostgreSQL/Plugins/IndexPlugin.cpp	Fri Mar 22 14:42:36 2024 +0100
+++ b/PostgreSQL/Plugins/IndexPlugin.cpp	Fri Mar 22 15:03:26 2024 +0100
@@ -28,6 +28,8 @@
 
 #include <google/protobuf/any.h>
 
+#define ORTHANC_PLUGIN_NAME "postgresql-index"
+
 
 extern "C"
 {
@@ -35,7 +37,7 @@
   {
     GOOGLE_PROTOBUF_VERIFY_VERSION;
 
-    if (!OrthancDatabases::InitializePlugin(context, "PostgreSQL", true))
+    if (!OrthancDatabases::InitializePlugin(context, ORTHANC_PLUGIN_NAME, "PostgreSQL", true))
     {
       return -1;
     }
@@ -97,7 +99,7 @@
 
   ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
   {
-    return "postgresql-index";
+    return ORTHANC_PLUGIN_NAME;
   }
 
 
--- a/PostgreSQL/Plugins/StoragePlugin.cpp	Fri Mar 22 14:42:36 2024 +0100
+++ b/PostgreSQL/Plugins/StoragePlugin.cpp	Fri Mar 22 15:03:26 2024 +0100
@@ -26,11 +26,14 @@
 #include <Logging.h>
 #include <Toolbox.h>
 
+#define ORTHANC_PLUGIN_NAME "postgresql-storage"
+
+
 extern "C"
 {
   ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
   {
-    if (!OrthancDatabases::InitializePlugin(context, "PostgreSQL", false))
+    if (!OrthancDatabases::InitializePlugin(context, ORTHANC_PLUGIN_NAME, "PostgreSQL", false))
     {
       return -1;
     }
@@ -88,7 +91,7 @@
 
   ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
   {
-    return "postgresql-storage";
+    return ORTHANC_PLUGIN_NAME;
   }
 
 
--- a/SQLite/Plugins/IndexPlugin.cpp	Fri Mar 22 14:42:36 2024 +0100
+++ b/SQLite/Plugins/IndexPlugin.cpp	Fri Mar 22 15:03:26 2024 +0100
@@ -27,6 +27,8 @@
 
 #include <google/protobuf/any.h>
 
+#define ORTHANC_PLUGIN_NAME "sqlite-index"
+
 
 extern "C"
 {
@@ -34,7 +36,7 @@
   {
     GOOGLE_PROTOBUF_VERIFY_VERSION;
 
-    if (!OrthancDatabases::InitializePlugin(context, "SQLite", true))
+    if (!OrthancDatabases::InitializePlugin(context, ORTHANC_PLUGIN_NAME, "SQLite", true))
     {
       return -1;
     }
@@ -94,7 +96,7 @@
 
   ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
   {
-    return "sqlite-index";
+    return ORTHANC_PLUGIN_NAME;
   }