summaryrefslogtreecommitdiffstats
path: root/src/declarative/debugger
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@nokia.com>2011-06-21 15:59:44 +0200
committerAurindam Jana <aurindam.jana@nokia.com>2011-06-21 16:01:33 +0200
commit6cb43a9b72c67b71409a59fdeb419f390441f0c7 (patch)
tree291ee209dd1c5fed4af844e7515244b6f81763de /src/declarative/debugger
parent9b09ef514bb6c4c926440e3fbf19d7255f97a12f (diff)
Fix QDeclarativeInspector when starting with ,block
Change-Id: I3797567f22f61abf59ec5332ebc74b3fa37ede93 Reviewed-by: kkoehne
Diffstat (limited to 'src/declarative/debugger')
-rw-r--r--src/declarative/debugger/qdeclarativeinspectorservice.cpp14
-rw-r--r--src/declarative/debugger/qdeclarativeinspectorservice_p.h2
2 files changed, 14 insertions, 2 deletions
diff --git a/src/declarative/debugger/qdeclarativeinspectorservice.cpp b/src/declarative/debugger/qdeclarativeinspectorservice.cpp
index 9fec006f56..15dbf587bc 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 9fe0d601fa..9a141553f0 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;