diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-02-15 20:45:33 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2018-02-15 20:45:33 +0000 |
commit | d028d2850e7ab998b5e8565d10373a0e738b4b2b (patch) | |
tree | e8c19f1102626352e89522628b1cbcdfe26e4fb9 /tools | |
parent | ee3fe11b023ac3dfb449156db1d3732a70e3ff32 (diff) | |
parent | 242c9545af933c3b8ba30bb5d69263eea97142d0 (diff) |
Merge "Merge remote-tracking branch 'origin/5.10.1' into 5.11" into refs/staging/5.11
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.cpp | 18 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp index 0b0417bd7d..67e8769ac1 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.cpp +++ b/tools/qmlprofiler/qmlprofilerapplication.cpp @@ -93,6 +93,8 @@ QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) : connect(m_connection.data(), &QQmlDebugConnection::connected, this, &QmlProfilerApplication::connected); + connect(m_connection.data(), &QQmlDebugConnection::disconnected, + this, &QmlProfilerApplication::disconnected); connect(m_qmlProfilerClient.data(), &QmlProfilerClient::enabledChanged, this, &QmlProfilerApplication::traceClientEnabledChanged); @@ -515,6 +517,22 @@ void QmlProfilerApplication::connected() .arg(endpoint).arg(m_recording ? tr("on") : tr("off"))); } +void QmlProfilerApplication::disconnected() +{ + if (m_runMode == AttachMode) { + int exitCode = 0; + if (m_recording) { + logError("Connection dropped while recording, last trace is damaged!"); + exitCode = 2; + } + + if (!m_interactive ) + exit(exitCode); + else + m_qmlProfilerClient->clearAll(); + } +} + void QmlProfilerApplication::processHasOutput() { Q_ASSERT(m_process); diff --git a/tools/qmlprofiler/qmlprofilerapplication.h b/tools/qmlprofiler/qmlprofilerapplication.h index f7a8efd61b..2d00e2b7c5 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.h +++ b/tools/qmlprofiler/qmlprofilerapplication.h @@ -69,6 +69,7 @@ private: void run(); void tryToConnect(); void connected(); + void disconnected(); void processHasOutput(); void processFinished(); |