X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;f=src%2Flibs%2FPlugins%2Fpluginmanager.cpp;h=21db40b018ba2e7f10f34a4d2c1a0b66a8eef175;hb=2bf3bf2e6edd9cb9e56cf21bfec76b2a0f983ada;hp=2d8e269f3a141447fccbfb787fcf6871d07ffc2e;hpb=b4e0cc814aa897d5a4e1e35a329e31b6ddbe6d0b;p=evaf
diff --git a/src/libs/Plugins/pluginmanager.cpp b/src/libs/Plugins/pluginmanager.cpp
index 2d8e269..21db40b 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);
@@ -326,7 +325,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();
@@ -355,18 +354,18 @@ bool PluginManagerPrivate::loadQtPlugin(QString const & name) const
QString fileName;
#ifdef Q_OS_LINUX
- fileName = QString("%1libq%2.so").arg(Common::iEnv::instance()->qtPluginsDir()).arg(name);
+ fileName = QString("%1libq%2.so").arg(Common::iApp::instance()->qtPluginsDir()).arg(name);
# ifndef QT_NO_DEBUG
- QString t = QString("%1libq%2.so.debug").arg(Common::iEnv::instance()->qtPluginsDir()).arg(name);
+ QString t = QString("%1libq%2.so.debug").arg(Common::iApp::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");
+ fileName = QString("%1q%2%3").arg(Common::iApp::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");
+ QString t = QString("%1q%2%3").arg(Common::iApp::instance()->qtPluginsDir()).arg(name).arg("d4.dll");
if (!QFile::exists(t))
fileName = t;
# endif
@@ -414,7 +413,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 +457,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;