-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::iApp::instance()->qtPluginsDir()).arg(name);
-# ifndef QT_NO_DEBUG
- 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("%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::iApp::instance()->qtPluginsDir()).arg(name).arg("d4.dll");
- if (!QFile::exists(t))
- fileName = t;
-# endif
-#endif
-
-#ifdef Q_OS_CYGWIN
- fileName = QString("%1cygq%2.dll").arg(Common::iApp::instance()->qtPluginsDir()).arg(name);
-# ifndef QT_NO_DEBUG
- QString t = QString("%1libq%2.dll.debug").arg(Common::iApp::instance()->qtPluginsDir()).arg(name);
- 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;
- }
-}
-