summaryrefslogtreecommitdiffstats
path: root/akonadish/state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'akonadish/state.cpp')
-rw-r--r--akonadish/state.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/akonadish/state.cpp b/akonadish/state.cpp
index f3f5975..9fb5bcc 100644
--- a/akonadish/state.cpp
+++ b/akonadish/state.cpp
@@ -24,6 +24,8 @@
24#include <QEventLoop> 24#include <QEventLoop>
25#include <QTextStream> 25#include <QTextStream>
26 26
27#include "common/log.h"
28
27static bool s_hasEventLoop = false; 29static bool s_hasEventLoop = false;
28 30
29class State::Private 31class State::Private
@@ -112,6 +114,11 @@ void State::setHasEventLoop(bool evented)
112 s_hasEventLoop = evented; 114 s_hasEventLoop = evented;
113} 115}
114 116
117bool State::hasEventLoop()
118{
119 return s_hasEventLoop;
120}
121
115void State::setCommandTiming(bool time) 122void State::setCommandTiming(bool time)
116{ 123{
117 d->timing = time; 124 d->timing = time;
@@ -122,4 +129,16 @@ bool State::commandTiming() const
122 return d->timing; 129 return d->timing;
123} 130}
124 131
132void State::setLoggingLevel(const QString &level) const
133{
134 Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::debugLevelFromName(level.toLatin1()));
135}
136
137QString State::loggingLevel() const
138{
139 // do not turn this into a single line return: that core dumps due to allocation of
140 // the byte array in Akonadi2::Log
141 QByteArray rv = Akonadi2::Log::debugLevelName(Akonadi2::Log::debugOutputLevel());
142 return rv.toLower();
143}
125 144