aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlprofiler/qmlprofilerapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qmlprofiler/qmlprofilerapplication.cpp')
-rw-r--r--tools/qmlprofiler/qmlprofilerapplication.cpp18
1 files changed, 18 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);