diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-07-16 16:17:17 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-04 13:35:18 +0000 |
commit | 275ddd68af1881c5712848a4be9892f84b62b321 (patch) | |
tree | df846963158857e8b84a66f2d6e64f2528f0363e /src/qml/debugger | |
parent | 20d06b5e822cc301e31f77a87915eed62195eb92 (diff) |
Clean up QQmlDebugConnector's addService() and removeService()
As we look up services by name we should also add and remove them by
name. As the thread doesn't run during adding and removing of services
we don't have to check the client plugins for the initial state.
It's also a good idea to eventually disconnect any signals that we
connect on addService().
Change-Id: I9acd17d2caafe15831f32b7b959dc2dea9cab08c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/debugger')
-rw-r--r-- | src/qml/debugger/qqmldebugconnector_p.h | 4 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugservice.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/debugger/qqmldebugconnector_p.h b/src/qml/debugger/qqmldebugconnector_p.h index a4531bf1a9..02e94811a6 100644 --- a/src/qml/debugger/qqmldebugconnector_p.h +++ b/src/qml/debugger/qqmldebugconnector_p.h @@ -67,8 +67,8 @@ public: virtual void addEngine(QQmlEngine *engine) = 0; virtual void removeEngine(QQmlEngine *engine) = 0; - virtual bool addService(QQmlDebugService *service) = 0; - virtual bool removeService(QQmlDebugService *service) = 0; + virtual bool addService(const QString &name, QQmlDebugService *service) = 0; + virtual bool removeService(const QString &name) = 0; virtual bool open(const QVariantHash &configuration = QVariantHash()) = 0; diff --git a/src/qml/debugger/qqmldebugservice.cpp b/src/qml/debugger/qqmldebugservice.cpp index 3a69799da8..0b07f320ec 100644 --- a/src/qml/debugger/qqmldebugservice.cpp +++ b/src/qml/debugger/qqmldebugservice.cpp @@ -72,7 +72,7 @@ QQmlDebugService::QQmlDebugService(const QString &name, float version, QObject * if (server->service(d->name)) { qWarning() << "QQmlDebugService: Conflicting plugin name" << d->name; } else { - server->addService(this); + server->addService(d->name, this); } } @@ -87,7 +87,7 @@ QQmlDebugService::~QQmlDebugService() if (server->service(d->name) != this) qWarning() << "QQmlDebugService: Plugin" << d->name << "is not registered."; else - server->removeService(this); + server->removeService(d->name); } const QString &QQmlDebugService::name() const |