diff Plugins/Engine/PluginsManager.cpp @ 1272:7442097b41c9

Scan of folders for plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 12 Jan 2015 17:42:29 +0100
parents f1c01451a8ee
children 6e7e5ed91c2d
line wrap: on
line diff
--- a/Plugins/Engine/PluginsManager.cpp	Fri Jan 09 17:23:02 2015 +0100
+++ b/Plugins/Engine/PluginsManager.cpp	Mon Jan 12 17:42:29 2015 +0100
@@ -226,6 +226,18 @@
   
   void PluginsManager::RegisterPlugin(const std::string& path)
   {
+    if (!boost::filesystem::exists(path))
+    {
+      LOG(ERROR) << "Inexistent path to plugins: " << path;
+      return;
+    }
+
+    if (boost::filesystem::is_directory(path))
+    {
+      ScanFolderForPlugins(path, false);
+      return;
+    }
+
     std::auto_ptr<Plugin> plugin(new Plugin(path));
 
     if (!IsOrthancPlugin(plugin->GetLibrary()))