Debugger: Create InspectorService only when debugging is enabled
authorKai Koehne <kai.koehne@nokia.com>
Sat, 15 Oct 2011 13:56:06 +0000 (15:56 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 17 Oct 2011 12:56:09 +0000 (14:56 +0200)
Change-Id: Ie9704233012b0bd0e473c5ee6011e6382c61900f
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
src/declarative/items/qsgview.cpp
src/qtquick1/util/qdeclarativeview.cpp

index cd20f6c..841c8eb 100644 (file)
@@ -68,7 +68,8 @@ void QSGViewPrivate::init()
 
     engine.setIncubationController(q->incubationController());
 
-    QDeclarativeInspectorService::instance()->addView(q);
+    if (QDeclarativeDebugService::isDebuggingEnabled())
+        QDeclarativeInspectorService::instance()->addView(q);
 }
 
 QSGViewPrivate::QSGViewPrivate()
@@ -78,7 +79,8 @@ QSGViewPrivate::QSGViewPrivate()
 
 QSGViewPrivate::~QSGViewPrivate()
 {
-    QDeclarativeInspectorService::instance()->removeView(q_func());
+    if (QDeclarativeDebugService::isDebuggingEnabled())
+        QDeclarativeInspectorService::instance()->removeView(q_func());
 
     delete root;
 }
index fd5f9de..8581947 100644 (file)
@@ -304,7 +304,8 @@ void QDeclarativeViewPrivate::init()
     q->viewport()->setAttribute(Qt::WA_NoSystemBackground);
 #endif
 
-    QDeclarativeInspectorService::instance()->addView(q);
+    if (QDeclarativeDebugService::isDebuggingEnabled())
+        QDeclarativeInspectorService::instance()->addView(q);
 }
 
 /*!
@@ -312,7 +313,8 @@ void QDeclarativeViewPrivate::init()
  */
 QDeclarativeView::~QDeclarativeView()
 {
-    QDeclarativeInspectorService::instance()->removeView(this);
+    if (QDeclarativeDebugService::isDebuggingEnabled())
+        QDeclarativeInspectorService::instance()->removeView(this);
 }
 
 /*! \property QDeclarativeView::source