aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp
index a4f5bd28f0..5c86c45116 100644
--- a/src/declarative/debugger/qdeclarativedebugserver.cpp
+++ b/src/declarative/debugger/qdeclarativedebugserver.cpp
@@ -98,7 +98,8 @@ public:
private:
// private slot
void _q_deliverMessage(const QString &serviceName, const QByteArray &message);
- static QDeclarativeDebugServerConnection *loadConnectionPlugin(const QString &pluginName);
+ static QDeclarativeDebugServerConnection *loadConnectionPlugin(QPluginLoader *loader, const QString &pluginName);
+
};
QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() :
@@ -122,7 +123,7 @@ void QDeclarativeDebugServerPrivate::advertisePlugins()
}
QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectionPlugin(
- const QString &pluginName)
+ QPluginLoader *loader, const QString &pluginName)
{
#ifndef QT_NO_LIBRARY
QStringList pluginCandidates;
@@ -142,14 +143,14 @@ QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectio
if (qmlDebugVerbose())
qDebug() << "QDeclarativeDebugServer: Trying to load plugin " << pluginPath << "...";
- QPluginLoader loader(pluginPath);
- if (!loader.load()) {
+ loader->setFileName(pluginPath);
+ if (!loader->load()) {
if (qmlDebugVerbose())
- qDebug() << "QDeclarativeDebugServer: Error while loading: " << loader.errorString();
+ qDebug() << "QDeclarativeDebugServer: Error while loading: " << loader->errorString();
continue;
}
QDeclarativeDebugServerConnection *connection = 0;
- if (QObject *instance = loader.instance())
+ if (QObject *instance = loader->instance())
connection = qobject_cast<QDeclarativeDebugServerConnection*>(instance);
if (connection) {
@@ -162,7 +163,7 @@ QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectio
if (qmlDebugVerbose())
qDebug() << "QDeclarativeDebugServer: Plugin does not implement interface QDeclarativeDebugServerConnection.";
- loader.unload();
+ loader->unload();
}
#endif
return 0;
@@ -215,9 +216,9 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
if (ok) {
server = new QDeclarativeDebugServer();
-
+ QPluginLoader *loader = new QPluginLoader(server);
QDeclarativeDebugServerConnection *connection
- = QDeclarativeDebugServerPrivate::loadConnectionPlugin(pluginName);
+ = QDeclarativeDebugServerPrivate::loadConnectionPlugin(loader, pluginName);
if (connection) {
server->d_func()->connection = connection;