diff MySQL/Plugins/MySQLIndex.cpp @ 201:42990b2dd51b

create IDatabaseBackendOutput only if needed
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 18 Mar 2021 16:51:51 +0100
parents 8cae98f73d53
children 2089d4071408
line wrap: on
line diff
--- a/MySQL/Plugins/MySQLIndex.cpp	Thu Mar 18 15:21:17 2021 +0100
+++ b/MySQL/Plugins/MySQLIndex.cpp	Thu Mar 18 16:51:51 2021 +0100
@@ -267,8 +267,9 @@
   }
 
 
-  MySQLIndex::MySQLIndex(const MySQLParameters& parameters) :
-    IndexBackend(new Factory(*this)),
+  MySQLIndex::MySQLIndex(OrthancPluginContext* context,
+                         const MySQLParameters& parameters) :
+    IndexBackend(context, new Factory(*this)),
     parameters_(parameters),
     clearAll_(false)
   {
@@ -305,7 +306,8 @@
   }
 
 
-  void MySQLIndex::DeleteResource(int64_t id)
+  void MySQLIndex::DeleteResource(OrthancPlugins::IDatabaseBackendOutput& output,
+                                  int64_t id)
   {
     ClearDeletedFiles();
 
@@ -363,7 +365,7 @@
     
             parent.Execute(args);
 
-            GetOutput().SignalRemainingAncestor(
+            output.SignalRemainingAncestor(
               ReadString(parent, 0),
               static_cast<OrthancPluginResourceType>(ReadInteger32(parent, 1)));
           }
@@ -384,7 +386,7 @@
       deleteHierarchy.Execute(args);
     }
 
-    SignalDeletedFiles();
+    SignalDeletedFiles(output);
   }