diff --git a/src/plugins/qmlprofiler/localqmlprofilerrunner.h b/src/plugins/qmlprofiler/localqmlprofilerrunner.h index 2a8b7031b247a4307166b51d2fd1756082ea21f3..b4d45d4ca332798bbd507c95003dbe096b967978 100644 --- a/src/plugins/qmlprofiler/localqmlprofilerrunner.h +++ b/src/plugins/qmlprofiler/localqmlprofilerrunner.h @@ -62,6 +62,8 @@ public: virtual void stop(); virtual int debugPort() const; + bool hasExecutable() const { return !m_configuration.executable.isEmpty(); } + private slots: void spontaneousStop(int exitCode); diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 8b4d72edd3cc2c9556a4d793dadd34ee268fa7b9..c4324f1d5ca9461fe7dad713ea19e4a2f8ef2948 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -150,12 +150,20 @@ void QmlProfilerEngine::start() qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration())) { if (rc->observerPath().isEmpty()) { QmlProjectManager::QmlProjectPlugin::showQmlObserverToolWarning(); + AnalyzerManager::stopTool(); return; } } d->m_runner = QmlProfilerEnginePrivate::createRunner(runConfiguration(), this); + if (LocalQmlProfilerRunner *qmlRunner = qobject_cast<LocalQmlProfilerRunner *>(d->m_runner)) { + if (!qmlRunner->hasExecutable()) { + showNoExecutableWarning(); + AnalyzerManager::stopTool(); + return; + } + } connect(d->m_runner, SIGNAL(stopped()), this, SLOT(stopped())); connect(d->m_runner, SIGNAL(appendMessage(QString,Utils::OutputFormat)), @@ -292,5 +300,18 @@ void QmlProfilerEngine::wrongSetupMessageBoxFinished(int button) } } +void QmlProfilerEngine::showNoExecutableWarning() +{ + Core::ICore * const core = Core::ICore::instance(); + QMessageBox *noExecWarning = new QMessageBox(core->mainWindow()); + noExecWarning->setIcon(QMessageBox::Warning); + noExecWarning->setWindowTitle(tr("QML Profiler")); + noExecWarning->setText(tr("No executable file to launch.")); + noExecWarning->setStandardButtons(QMessageBox::Ok); + noExecWarning->setDefaultButton(QMessageBox::Ok); + noExecWarning->setModal(false); + noExecWarning->show(); +} + } // namespace Internal } // namespace QmlProfiler diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.h b/src/plugins/qmlprofiler/qmlprofilerengine.h index 02dceaf8e2e5b0fd0a9d3ba074df6af6b1c15216..48b3457ed5dc0d66593eef6a307a211581db3e6f 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.h +++ b/src/plugins/qmlprofiler/qmlprofilerengine.h @@ -48,6 +48,7 @@ public: ProjectExplorer::RunConfiguration *runConfiguration); ~QmlProfilerEngine(); + static void showNoExecutableWarning(); signals: void processRunning(int port); void stopRecording();