diff options
author | Eike Ziller <eike.ziller@qt.io> | 2016-08-31 14:40:38 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2016-08-31 14:40:38 +0200 |
commit | c56aa52b8082bf39bd822f8d110f4a41757100f9 (patch) | |
tree | 22ee09ed89b75d1e08674f5836bb516c8f1ab048 /src/plugins/qmlprofiler | |
parent | a4bf137a9f0319c6f3b9ecc3345d1ab9520f128c (diff) | |
parent | 89ff2c1db5ee2068cf763ff1789b17b7f2afa118 (diff) | |
download | qt-creator-c56aa52b8082bf39bd822f8d110f4a41757100f9.tar.gz |
Merge remote-tracking branch 'origin/4.1'
Conflicts:
qbs/modules/qtc/qtc.qbs
qtcreator.pri
src/plugins/qmakeprojectmanager/makestep.cpp
src/shared/qbs
Change-Id: If1787ed23afa786ed2cef57f53c1db642559cbe0
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r-- | src/plugins/qmlprofiler/localqmlprofilerrunner.cpp | 29 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/localqmlprofilerrunner.h | 2 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp | 30 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerruncontrol.h | 4 |
4 files changed, 36 insertions, 29 deletions
diff --git a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp index 3be605542e..bffe0d23c8 100644 --- a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp +++ b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp @@ -79,6 +79,35 @@ LocalQmlProfilerRunner::LocalQmlProfilerRunner(const Configuration &configuratio this, &LocalQmlProfilerRunner::start); connect(runControl, &RunControl::finished, this, &LocalQmlProfilerRunner::stop); + + m_outputParser.setNoOutputText(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput()); + + connect(runControl, &Debugger::AnalyzerRunControl::appendMessageRequested, + this, [this](RunControl *runControl, const QString &msg, Utils::OutputFormat format) { + Q_UNUSED(runControl); + Q_UNUSED(format); + m_outputParser.processOutput(msg); + }); + + connect(&m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort, + runControl, [this, runControl](Utils::Port port) { + runControl->notifyRemoteSetupDone(port); + }); + + connect(&m_outputParser, &QmlDebug::QmlOutputParser::noOutputMessage, + runControl, [this, runControl]() { + runControl->notifyRemoteSetupDone(Utils::Port()); + }); + + connect(&m_outputParser, &QmlDebug::QmlOutputParser::connectingToSocketMessage, + runControl, [this, runControl]() { + runControl->notifyRemoteSetupDone(Utils::Port()); + }); + + connect(&m_outputParser, &QmlDebug::QmlOutputParser::errorMessage, + runControl, [this, runControl](const QString &message) { + runControl->notifyRemoteSetupFailed(message); + }); } void LocalQmlProfilerRunner::start() diff --git a/src/plugins/qmlprofiler/localqmlprofilerrunner.h b/src/plugins/qmlprofiler/localqmlprofilerrunner.h index 0122771b57..bcbd996af8 100644 --- a/src/plugins/qmlprofiler/localqmlprofilerrunner.h +++ b/src/plugins/qmlprofiler/localqmlprofilerrunner.h @@ -30,6 +30,7 @@ #include <utils/port.h> #include <projectexplorer/applicationlauncher.h> #include <projectexplorer/runnables.h> +#include <qmldebug/qmloutputparser.h> namespace Debugger { class AnalyzerRunControl; @@ -66,6 +67,7 @@ private: Configuration m_configuration; ProjectExplorer::ApplicationLauncher m_launcher; + QmlDebug::QmlOutputParser m_outputParser; }; } // namespace QmlProfiler diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp index 55a47e3f59..224e5652cf 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp @@ -70,7 +70,6 @@ public: Internal::QmlProfilerTool *m_tool = 0; QmlProfilerStateManager *m_profilerState = 0; QTimer m_noDebugOutputTimer; - QmlDebug::QmlOutputParser m_outputParser; bool m_running = false; }; @@ -90,18 +89,9 @@ QmlProfilerRunControl::QmlProfilerRunControl(RunConfiguration *runConfiguration, // (application output might be redirected / blocked) d->m_noDebugOutputTimer.setSingleShot(true); d->m_noDebugOutputTimer.setInterval(4000); - connect(&d->m_noDebugOutputTimer, &QTimer::timeout, - this, [this](){processIsRunning(Utils::Port());}); - - d->m_outputParser.setNoOutputText(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput()); - connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort, - this, &QmlProfilerRunControl::processIsRunning); - connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::noOutputMessage, - this, [this](){processIsRunning(Utils::Port());}); - connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::connectingToSocketMessage, - this, [this](){processIsRunning(Utils::Port());}); - connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::errorMessage, - this, &QmlProfilerRunControl::wrongSetupMessageBox); + connect(&d->m_noDebugOutputTimer, &QTimer::timeout, this, [this]() { + notifyRemoteSetupDone(Utils::Port()); + }); } QmlProfilerRunControl::~QmlProfilerRunControl() @@ -203,13 +193,7 @@ void QmlProfilerRunControl::cancelProcess() emit finished(); } -void QmlProfilerRunControl::appendMessage(const QString &msg, Utils::OutputFormat format) -{ - AnalyzerRunControl::appendMessage(msg, format); - d->m_outputParser.processOutput(msg); -} - -void QmlProfilerRunControl::wrongSetupMessageBox(const QString &errorMessage) +void QmlProfilerRunControl::notifyRemoteSetupFailed(const QString &errorMessage) { QMessageBox *infoBox = new QMessageBox(ICore::mainWindow()); infoBox->setIcon(QMessageBox::Critical); @@ -244,12 +228,6 @@ void QmlProfilerRunControl::wrongSetupMessageBoxFinished(int button) void QmlProfilerRunControl::notifyRemoteSetupDone(Utils::Port port) { d->m_noDebugOutputTimer.stop(); - emit processRunning(port); -} - -void QmlProfilerRunControl::processIsRunning(Utils::Port port) -{ - d->m_noDebugOutputTimer.stop(); if (!port.isValid()) { QTC_ASSERT(connection().is<AnalyzerConnection>(), return); diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.h b/src/plugins/qmlprofiler/qmlprofilerruncontrol.h index b1a1f121fe..49716c05a4 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.h +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.h @@ -46,21 +46,19 @@ public: void registerProfilerStateManager( QmlProfilerStateManager *profilerState ); void notifyRemoteSetupDone(Utils::Port port) override; + void notifyRemoteSetupFailed(const QString &errorMessage) override; void start() override; StopResult stop() override; bool isRunning() const override; void cancelProcess(); void notifyRemoteFinished() override; - void appendMessage(const QString &msg, Utils::OutputFormat format) override; bool supportsReRunning() const override { return false; } signals: void processRunning(Utils::Port port); private: - void wrongSetupMessageBox(const QString &errorMessage); void wrongSetupMessageBoxFinished(int); - void processIsRunning(Utils::Port port); void profilerStateChanged(); class QmlProfilerRunControlPrivate; |