From 409ed3b275059b31257cee02ff271af0efa6c55a Mon Sep 17 00:00:00 2001
From: Christiaan Janssen <christiaan.janssen@nokia.com>
Date: Thu, 21 Jul 2011 10:42:34 +0200
Subject: [PATCH] QmlProfiler: show warning when no observer is present

Task-number: QTCREATORBUG-5536
Change-Id: I2cd1e62f78af3b1b18a3e318ad29ee0343c48b29
Reviewed-on: http://codereview.qt.nokia.com/1930
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
---
 src/plugins/qmlprofiler/qmlprofilerengine.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp
index 829f26ea5d3..8b4d72edd3c 100644
--- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp
@@ -46,6 +46,7 @@
 #include <utils/qtcassert.h>
 #include <coreplugin/helpmanager.h>
 #include <qmlprojectmanager/qmlprojectrunconfiguration.h>
+#include <qmlprojectmanager/qmlprojectplugin.h>
 #include <projectexplorer/localapplicationruncontrol.h>
 #include <projectexplorer/applicationrunconfiguration.h>
 #include <qt4projectmanager/qt-s60/s60devicedebugruncontrol.h>
@@ -144,6 +145,15 @@ QmlProfilerEngine::~QmlProfilerEngine()
 void QmlProfilerEngine::start()
 {
     QTC_ASSERT(!d->m_runner, return);
+
+    if (QmlProjectManager::QmlProjectRunConfiguration *rc =
+            qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration())) {
+        if (rc->observerPath().isEmpty()) {
+            QmlProjectManager::QmlProjectPlugin::showQmlObserverToolWarning();
+            return;
+        }
+    }
+
     d->m_runner = QmlProfilerEnginePrivate::createRunner(runConfiguration(), this);
 
 
-- 
GitLab