Parcourir la source

Moved library pre-loading before framework initialization. Fixes #324.

Also improved diagnostic console output.
Sascha Zelzer il y a 12 ans
Parent
commit
54adfa9ed7
1 fichiers modifiés avec 10 ajouts et 10 suppressions
  1. 10 10
      Libs/PluginFramework/ctkPluginFrameworkContext.cpp

+ 10 - 10
Libs/PluginFramework/ctkPluginFrameworkContext.cpp

@@ -78,14 +78,6 @@ void ctkPluginFrameworkContext::init()
     firstInit = false;
   }
 
-  ctkPluginFrameworkPrivate* const systemPluginPrivate = systemPlugin->d_func();
-  systemPluginPrivate->initSystemPlugin();
-
-  storage = new ctkPluginStorageSQL(this);
-  dataStorage = ctkPluginFrameworkUtil::getFileStorage(this, "data");
-  services = new ctkServices(this);
-  plugins = new ctkPlugins(this);
-
   // Pre-load libraries
   // This may speed up installing new plug-ins if they have dependencies on
   // one of these libraries. It prevents repeated loading and unloading of the
@@ -123,14 +115,22 @@ void ctkPluginFrameworkContext::init()
       }
 
       lib.setLoadHints(loadHints);
-      log() << "Pre-loading library" << libraryName << "with hints [" << static_cast<int>(loadHints) << "]";
+      log() << "Pre-loading library" << lib.fileName() << "with hints [" << static_cast<int>(loadHints) << "]";
       if (!lib.load())
       {
-        qWarning() << "Pre-loading library" << libraryName << "failed. Check your library search paths.";
+        qWarning() << "Pre-loading library" << lib.fileName() << "failed:" << lib.errorString() << "\nCheck your library search paths.";
       }
     }
   }
 
+  ctkPluginFrameworkPrivate* const systemPluginPrivate = systemPlugin->d_func();
+  systemPluginPrivate->initSystemPlugin();
+
+  storage = new ctkPluginStorageSQL(this);
+  dataStorage = ctkPluginFrameworkUtil::getFileStorage(this, "data");
+  services = new ctkServices(this);
+  plugins = new ctkPlugins(this);
+
   plugins->load();
 
   log() << "inited";