summaryrefslogtreecommitdiffstats
path: root/akonadish/syntaxtree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'akonadish/syntaxtree.cpp')
-rw-r--r--akonadish/syntaxtree.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/akonadish/syntaxtree.cpp b/akonadish/syntaxtree.cpp
index 899fc61..dbbff01 100644
--- a/akonadish/syntaxtree.cpp
+++ b/akonadish/syntaxtree.cpp
@@ -62,16 +62,19 @@ Syntax::List SyntaxTree::syntax() const
62 62
63bool SyntaxTree::run(const QStringList &commands) 63bool SyntaxTree::run(const QStringList &commands)
64{ 64{
65 bool success = false;
66 m_timeElapsed.start();
65 Command command = match(commands); 67 Command command = match(commands);
66 if (command.first && command.first->lambda) { 68 if (command.first && command.first->lambda) {
67 bool rv = command.first->lambda(command.second, m_state); 69 success = command.first->lambda(command.second, m_state);
68 if (rv && command.first->interactivity == Syntax::EventDriven) { 70 if (success && command.first->interactivity == Syntax::EventDriven) {
69 return m_state.commandStarted(); 71 success = m_state.commandStarted();
70 } 72 }
71
72 return rv;
73 } 73 }
74 74
75 if (m_state.commandTiming()) {
76 m_state.printLine(QObject::tr("Time elapsed: %1").arg(m_timeElapsed.elapsed()));
77 }
75 return false; 78 return false;
76} 79}
77 80