From 0a882e76dde2795f2f74ca28f775a74ac7177f54 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 23 Dec 2015 20:23:10 +0100 Subject: start the loop via State and only if the command succeeded in setting up --- akonadi2_cli/syntaxtree.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'akonadi2_cli') diff --git a/akonadi2_cli/syntaxtree.cpp b/akonadi2_cli/syntaxtree.cpp index fe1acfb..e87b291 100644 --- a/akonadi2_cli/syntaxtree.cpp +++ b/akonadi2_cli/syntaxtree.cpp @@ -67,12 +67,12 @@ bool SyntaxTree::run(const QStringList &commands) { Command command = match(commands); if (command.first && command.first->lambda) { - command.first->lambda(command.second, m_state); - if (command.first->interactivity == Syntax::EventDriven) { - return QCoreApplication::instance()->exec(); + bool rv = command.first->lambda(command.second, m_state); + if (rv && command.first->interactivity == Syntax::EventDriven) { + return m_state.commandStarted(); } - return true; + return rv; } return false; -- cgit v1.2.3