From cd0b001ec8153515b4af549e4b111bada14ebce7 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 21 May 2015 17:13:03 +0200 Subject: qmlprofiler: Improve options for trace output * Remove the auto-generation of file names. * Accept file names as parameters or from interactive commands * Output to stdout by default for better scripting and quick preview * Decouple output from clearing of data so that you can write the same data multiple times. Task-number: QTBUG-43066 Change-Id: Ia4cc3701cbac7c6f8948b11307130a5d6a2ff44c Reviewed-by: Joerg Bornemann --- tools/qmlprofiler/qmlprofilerapplication.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'tools/qmlprofiler/qmlprofilerapplication.h') diff --git a/tools/qmlprofiler/qmlprofilerapplication.h b/tools/qmlprofiler/qmlprofilerapplication.h index 8d2cbffe7b..8f5be179b6 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.h +++ b/tools/qmlprofiler/qmlprofilerapplication.h @@ -41,6 +41,15 @@ #include "qmlprofilerclient.h" #include "qmlprofilerdata.h" +enum PendingRequest { + REQUEST_QUIT, + REQUEST_FLUSH_FILE, + REQUEST_FLUSH, + REQUEST_OUTPUT_FILE, + REQUEST_TOGGLE_RECORDING, + REQUEST_NONE +}; + class QmlProfilerApplication : public QCoreApplication { Q_OBJECT @@ -72,7 +81,7 @@ private slots: void profilerClientEnabled(); void traceFinished(); - void print(const QString &line); + void prompt(const QString &line = QString(), bool ready = true); void logError(const QString &error); void logStatus(const QString &status); @@ -80,8 +89,9 @@ private slots: void v8Complete(); private: - void printCommands(); - QString traceFileName() const; + bool checkOutputFile(PendingRequest pending); + void flush(); + void output(); enum ApplicationMode { LaunchMode, @@ -96,8 +106,11 @@ private: QString m_hostName; quint16 m_port; + QString m_outputFile; + QString m_interactiveOutputFile; + + PendingRequest m_pendingRequest; bool m_verbose; - bool m_quitAfterSave; bool m_recording; bool m_interactive; -- cgit v1.2.3