summaryrefslogtreecommitdiffstats
path: root/sinksh/state.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-08-30 00:48:59 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-09-15 16:14:19 +0200
commit3d8802e235e9508a0bf3d8a1168ad11c95571579 (patch)
tree6472bbd934dea6081b5a5ab1464989d4f8cec8df /sinksh/state.cpp
parent6b09016f5d9119729265211db6cc91f991fc3e28 (diff)
downloadsink-3d8802e235e9508a0bf3d8a1168ad11c95571579.tar.gz
sink-3d8802e235e9508a0bf3d8a1168ad11c95571579.zip
Also call commandFinished in the error case.
Diffstat (limited to 'sinksh/state.cpp')
-rw-r--r--sinksh/state.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/sinksh/state.cpp b/sinksh/state.cpp
index 6fce21f..8f4a675 100644
--- a/sinksh/state.cpp
+++ b/sinksh/state.cpp
@@ -26,6 +26,8 @@
26 26
27#include "common/log.h" 27#include "common/log.h"
28 28
29SINK_DEBUG_AREA("state")
30
29static bool s_hasEventLoop = false; 31static bool s_hasEventLoop = false;
30 32
31class State::Private 33class State::Private
@@ -127,6 +129,7 @@ unsigned int State::debugLevel() const
127 129
128int State::commandStarted() const 130int State::commandStarted() const
129{ 131{
132 SinkTrace() << "Command started";
130 if (!s_hasEventLoop) { 133 if (!s_hasEventLoop) {
131 return QCoreApplication::exec(); 134 return QCoreApplication::exec();
132 } else if (!d->eventLoop()->isRunning()) { 135 } else if (!d->eventLoop()->isRunning()) {
@@ -138,6 +141,7 @@ int State::commandStarted() const
138 141
139void State::commandFinished(int returnCode) const 142void State::commandFinished(int returnCode) const
140{ 143{
144 SinkTrace() << "Command finished";
141 if (!s_hasEventLoop) { 145 if (!s_hasEventLoop) {
142 QCoreApplication::exit(returnCode); 146 QCoreApplication::exit(returnCode);
143 } else { 147 } else {