X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;ds=inline;f=src%2Flibs%2FPlugins%2Fpluginmanager.cpp;h=5d08dcb10ddff65bf4ed64d207371d139ec542d6;hb=a81a943bee20df3c7eb34bafb3e3fe878facfe4e;hp=2d8e269f3a141447fccbfb787fcf6871d07ffc2e;hpb=b4e0cc814aa897d5a4e1e35a329e31b6ddbe6d0b;p=evaf
diff --git a/src/libs/Plugins/pluginmanager.cpp b/src/libs/Plugins/pluginmanager.cpp
index 2d8e269..5d08dcb 100644
--- a/src/libs/Plugins/pluginmanager.cpp
+++ b/src/libs/Plugins/pluginmanager.cpp
@@ -25,7 +25,6 @@
#include
#include
#include
-#include
#include
#include
@@ -145,7 +144,7 @@ void PluginManagerPrivate::done()
bool PluginManagerPrivate::loadPlugins()
{
// Get the name of the application's XML file
- QString xmlFileName = Common::iEnv::instance()->etcDir() + Common::iApp::instance()->xmlFileName();
+ QString xmlFileName = Common::iApp::instance()->etcDir() + Common::iApp::instance()->xmlFileName();
// Open the XML file
QFile xmlFile(xmlFileName);
@@ -292,14 +291,8 @@ bool PluginManagerPrivate::loadPlugins()
} // End element?
}
- // Load Qt plugins
- int i;
- for (i = 0; i < qtPlugins.size(); ++i) {
- loadQtPlugin(qtPlugins.at(i));
- }
-
// Load eVaf plugins
- i = 0;
+ int i = 0;
while (i < mPlugins.size()) {
if (!mPlugins.at(i)->load()) {
EVAF_ERROR("Failed to load module '%s'", qPrintable(mPlugins.at(i)->name()));
@@ -326,7 +319,7 @@ bool PluginManagerPrivate::loadPlugins()
void PluginManagerPrivate::unloadPlugins()
{
// Finalize all the plugins
- for (int i = 0; i < mPlugins.size(); ++i)
+ for (int i = mPlugins.size() - 1; i >= 0; --i)
mPlugins.at(i)->done();
while (!mPlugins.isEmpty()) {
QExplicitlySharedDataPointer p = mPlugins.takeLast();
@@ -349,48 +342,6 @@ Module * PluginManagerPrivate::moduleByName(QString const & name) const
return 0;
}
-bool PluginManagerPrivate::loadQtPlugin(QString const & name) const
-{
- // Get the Qt plugin file name with the full path
- QString fileName;
-
-#ifdef Q_OS_LINUX
- fileName = QString("%1libq%2.so").arg(Common::iEnv::instance()->qtPluginsDir()).arg(name);
-# ifndef QT_NO_DEBUG
- QString t = QString("%1libq%2.so.debug").arg(Common::iEnv::instance()->qtPluginsDir()).arg(name);
- if (QFile::exists(t))
- fileName = t;
-# endif
-#endif
-
-#ifdef Q_OS_WIN32
- fileName = QString("%2q%2%3").arg(Common::iEnv::instance()->qtPluginsDir()).arg(name).arg("4.dll");
-# ifndef QT_NO_DEBUG
- QString t = QString("%1q%2%3").arg(Common::iEnv::instance()->qtPluginsDir()).arg(name).arg("d4.dll");
- if (!QFile::exists(t))
- fileName = t;
-# endif
-#endif
-
- if (fileName.isEmpty()) {
- EVAF_ERROR("Don\'t know how to load Qt plugin '%s'", qPrintable(name));
- return false;
- }
-
- EVAF_INFO("Loading Qt plugin '%s'", qPrintable(fileName));
-
- QLibrary lib(fileName);
- void * fn = lib.resolve("qt_plugin_instance");
- if (fn) {
- qRegisterStaticPluginInstanceFunction(QtPluginInstanceFunction(fn));
- return true;
- }
- else {
- EVAF_ERROR("Failed to load Qt plugin '%s' : %s", qPrintable(fileName), qPrintable(lib.errorString()));
- return false;
- }
-}
-
//-------------------------------------------------------------------
@@ -414,7 +365,7 @@ Module::~Module()
bool Module::load()
{
// The real file name with path
- QString fileName = Common::iEnv::instance()->binDir() + expandPluginName(mName);
+ QString fileName = Common::iApp::instance()->binDir() + expandPluginName(mName);
// Try to load the module
QScopedPointer p(new QPluginLoader(fileName));
@@ -458,7 +409,7 @@ iPlugin * Module::create(QString const & name)
// If the module is not loaded, load it now
if (!mLoader) {
if (!load())
- return false;
+ return 0;
}
iPlugin * i = 0;