aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlprofiler
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-02-15 21:05:45 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-02-15 21:05:45 +0100
commitcf142cd637620e2af6ede46c4f2cefe0206d6159 (patch)
tree10ec6455b795a45152999e74335e5ae7f592903a /tools/qmlprofiler
parent70f35501da4d1bbb36703dcc7b121c454f8d57a9 (diff)
parent238cc098d785b4fe76fbc8422b340d98ff8c1a1b (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'tools/qmlprofiler')
-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 3ad906c790..fd65e1599a 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);
@@ -519,6 +521,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();