diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-05-21 17:13:03 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-06-06 21:13:25 +0000 |
commit | cd0b001ec8153515b4af549e4b111bada14ebce7 (patch) | |
tree | c0a38bc233eff945670dca2d43d1575458493d3a /tools/qmlprofiler/qmlprofilerapplication.h | |
parent | c402f593595f2705f8d0f73a13a08cb8bbda9421 (diff) |
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 <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tools/qmlprofiler/qmlprofilerapplication.h')
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.h | 21 |
1 files changed, 17 insertions, 4 deletions
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; |