diff options
author | Ulf Hermann <[email protected]> | 2015-05-21 15:37:52 +0200 |
---|---|---|
committer | Simon Hausmann <[email protected]> | 2015-06-07 08:26:19 +0000 |
commit | 6247e30afb0ee972f553f3905d893d2d586c6252 (patch) | |
tree | e65f8cd5f1cfcc949872eeba3ce69636369c51d1 | |
parent | aa68eab142c5e2106ab0c5e3a4bde6adfa550328 (diff) |
qmlprofiler: Output data after application quits in non-interactive mode
Change-Id: I38abed0d5af3bcc7be5fa9e21bde14be40a3ce1d
Reviewed-by: Joerg Bornemann <[email protected]>
-rw-r--r-- | tools/qmlprofiler/main.cpp | 4 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.cpp | 8 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.h | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/tools/qmlprofiler/main.cpp b/tools/qmlprofiler/main.cpp index 5496072eb2..12fcc79efa 100644 --- a/tools/qmlprofiler/main.cpp +++ b/tools/qmlprofiler/main.cpp @@ -53,6 +53,8 @@ int main(int argc, char *argv[]) listenerThread.wait(); return exitValue; } else { - return app.exec(); + int exitValue = app.exec(); + app.outputData(); + return exitValue; } } diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp index a9fa691cbc..1b3a90a1a1 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.cpp +++ b/tools/qmlprofiler/qmlprofilerapplication.cpp @@ -394,6 +394,14 @@ void QmlProfilerApplication::notifyTraceStarted() } } +void QmlProfilerApplication::outputData() +{ + if (!m_profilerData.isEmpty()) { + m_profilerData.save(m_outputFile); + m_profilerData.clear(); + } +} + void QmlProfilerApplication::run() { if (m_runMode == LaunchMode) { diff --git a/tools/qmlprofiler/qmlprofilerapplication.h b/tools/qmlprofiler/qmlprofilerapplication.h index 8f5be179b6..183bb9d644 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.h +++ b/tools/qmlprofiler/qmlprofilerapplication.h @@ -67,6 +67,7 @@ signals: public slots: void userCommand(const QString &command); void notifyTraceStarted(); + void outputData(); private slots: void run(); |