aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlprofiler/qmlprofilerapplication.cpp18
-rw-r--r--tools/qmlprofiler/qmlprofilerapplication.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp
index 033492b516..33be8722c0 100644
--- a/tools/qmlprofiler/qmlprofilerapplication.cpp
+++ b/tools/qmlprofiler/qmlprofilerapplication.cpp
@@ -91,6 +91,8 @@ QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) :
connect(&m_connection, &QQmlDebugConnection::connected,
this, &QmlProfilerApplication::connected);
+ connect(&m_connection, &QQmlDebugConnection::disconnected,
+ this, &QmlProfilerApplication::disconnected);
connect(&m_qmlProfilerClient, &QmlProfilerClient::enabledChanged,
this, &QmlProfilerApplication::traceClientEnabledChanged);
@@ -512,6 +514,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.clearPendingData();
+ }
+}
+
void QmlProfilerApplication::processHasOutput()
{
Q_ASSERT(m_process);
diff --git a/tools/qmlprofiler/qmlprofilerapplication.h b/tools/qmlprofiler/qmlprofilerapplication.h
index 13f0f041f0..4946622902 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();