diff options
author | Aurindam Jana <aurindam.jana@nokia.com> | 2011-06-21 13:59:44 (GMT) |
---|---|---|
committer | Aurindam Jana <aurindam.jana@nokia.com> | 2011-06-21 14:01:33 (GMT) |
commit | 6cb43a9b72c67b71409a59fdeb419f390441f0c7 (patch) | |
tree | 291ee209dd1c5fed4af844e7515244b6f81763de /src | |
parent | 9b09ef514bb6c4c926440e3fbf19d7255f97a12f (diff) | |
download | Qt-6cb43a9b72c67b71409a59fdeb419f390441f0c7.zip Qt-6cb43a9b72c67b71409a59fdeb419f390441f0c7.tar.gz Qt-6cb43a9b72c67b71409a59fdeb419f390441f0c7.tar.bz2 |
Fix QDeclarativeInspector when starting with ,block
Change-Id: I3797567f22f61abf59ec5332ebc74b3fa37ede93
Reviewed-by: kkoehne
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/debugger/qdeclarativeinspectorservice.cpp | 14 | ||||
-rw-r--r-- | src/declarative/debugger/qdeclarativeinspectorservice_p.h | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/declarative/debugger/qdeclarativeinspectorservice.cpp b/src/declarative/debugger/qdeclarativeinspectorservice.cpp index 9fec006..15dbf58 100644 --- a/src/declarative/debugger/qdeclarativeinspectorservice.cpp +++ b/src/declarative/debugger/qdeclarativeinspectorservice.cpp @@ -67,11 +67,13 @@ QDeclarativeInspectorService *QDeclarativeInspectorService::instance() void QDeclarativeInspectorService::addView(QDeclarativeView *view) { m_views.append(view); + updateStatus(); } void QDeclarativeInspectorService::removeView(QDeclarativeView *view) { m_views.removeAll(view); + updateStatus(); } void QDeclarativeInspectorService::sendMessage(const QByteArray &message) @@ -84,10 +86,18 @@ void QDeclarativeInspectorService::sendMessage(const QByteArray &message) void QDeclarativeInspectorService::statusChanged(Status status) { - if (m_views.isEmpty()) + updateStatus(); +} + +void QDeclarativeInspectorService::updateStatus() +{ + if (m_views.isEmpty()) { + if (m_inspectorPlugin) + m_inspectorPlugin->deactivate(); return; + } - if (status == Enabled) { + if (status() == Enabled) { if (!m_inspectorPlugin) m_inspectorPlugin = loadInspectorPlugin(); diff --git a/src/declarative/debugger/qdeclarativeinspectorservice_p.h b/src/declarative/debugger/qdeclarativeinspectorservice_p.h index 9fe0d601f..9a14155 100644 --- a/src/declarative/debugger/qdeclarativeinspectorservice_p.h +++ b/src/declarative/debugger/qdeclarativeinspectorservice_p.h @@ -78,6 +78,8 @@ protected: virtual void messageReceived(const QByteArray &); private: + void updateStatus(); + static QDeclarativeInspectorInterface *loadInspectorPlugin(); QList<QDeclarativeView*> m_views; |