aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlprofiler/commandlistener.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-05-21 15:39:28 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-06-06 15:20:33 +0000
commitc402f593595f2705f8d0f73a13a08cb8bbda9421 (patch)
treee2980f3b318b51a98ee0758b2ad1f8383f67fc82 /tools/qmlprofiler/commandlistener.cpp
parent8555cdecd66444b07ab09b1644cb42fcb572dd76 (diff)
qmlprofiler: Only accept commands if we ask for them
This way we can shut down the input thread after the last command and we cannot get commands before we can process them. Change-Id: Ie1583a338da9c9df0e07c9e09ce185857c5ea66d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tools/qmlprofiler/commandlistener.cpp')
-rw-r--r--tools/qmlprofiler/commandlistener.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/tools/qmlprofiler/commandlistener.cpp b/tools/qmlprofiler/commandlistener.cpp
index 1d538d8a3d..369d095725 100644
--- a/tools/qmlprofiler/commandlistener.cpp
+++ b/tools/qmlprofiler/commandlistener.cpp
@@ -35,24 +35,7 @@
#include "constants.h"
#include <QtCore/QTextStream>
-CommandListener::CommandListener(QObject *parent)
- : QThread(parent)
- , m_stopRequested(false)
+void CommandListener::readCommand()
{
-}
-
-void CommandListener::run()
-{
- QString line;
- QTextStream in(stdin, QIODevice::ReadOnly);
- do {
- line = in.readLine();
- line = line.trimmed();
- if (!line.isEmpty()) {
- emit command(line);
- if (line == QLatin1String(Constants::CMD_QUIT)
- || line == QLatin1String(Constants::CMD_QUIT2))
- return;
- }
- } while (!m_stopRequested && !line.isNull());
+ emit command(QTextStream(stdin).readLine());
}