Browse Source

Use ctkScopedCurrentDir in ctkFactoryPluginItem::load()

Doing so will ensure that the loader will properly find the dependent
library of the plugin if any.
Jean-Christophe Fillion-Robin 13 years ago
parent
commit
422b687008
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Libs/Core/ctkAbstractPluginFactory.tpp

+ 2 - 0
Libs/Core/ctkAbstractPluginFactory.tpp

@@ -23,6 +23,7 @@
 
 // CTK includes
 #include "ctkAbstractPluginFactory.h"
+#include "ctkScopedCurrentDir.h"
 
 // QT includes
 #include <QPluginLoader>
@@ -43,6 +44,7 @@ ctkFactoryPluginItem<BaseClassType>::ctkFactoryPluginItem(const QString& _path)
 template<typename BaseClassType>
 bool ctkFactoryPluginItem<BaseClassType>::load()
 {
+  ctkScopedCurrentDir scopedCurrentDir(QFileInfo(this->path()).path());
   this->Loader.setFileName(this->path());
   return this->Loader.load();
 }