summaryrefslogtreecommitdiffstats
path: root/akonadish/syntax_modules/akonadi_count.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'akonadish/syntax_modules/akonadi_count.cpp')
-rw-r--r--akonadish/syntax_modules/akonadi_count.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/akonadish/syntax_modules/akonadi_count.cpp b/akonadish/syntax_modules/akonadi_count.cpp
index e54ac22..70aabc9 100644
--- a/akonadish/syntax_modules/akonadi_count.cpp
+++ b/akonadish/syntax_modules/akonadi_count.cpp
@@ -17,8 +17,6 @@
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */ 18 */
19 19
20#include "akonadi_count.h"
21
22#include <QCoreApplication> 20#include <QCoreApplication>
23#include <QDebug> 21#include <QDebug>
24#include <QObject> // tr() 22#include <QObject> // tr()
@@ -35,20 +33,12 @@
35#include "common/definitions.h" 33#include "common/definitions.h"
36 34
37#include "akonadish_utils.h" 35#include "akonadish_utils.h"
36#include "state.h"
37#include "syntaxtree.h"
38 38
39namespace AkonadiCount 39namespace AkonadiCount
40{ 40{
41 41
42REGISTER_SYNTAX(AkonadiCount)
43
44Syntax::List syntax()
45{
46 Syntax::List syntax;
47 syntax << Syntax("count", QObject::tr("Returns the number of items of a given type in a resource. Usage: count <type> <resource>"), &AkonadiCount::count, Syntax::EventDriven);
48
49 return syntax;
50}
51
52bool count(const QStringList &args, State &state) 42bool count(const QStringList &args, State &state)
53{ 43{
54 auto resources = args; 44 auto resources = args;
@@ -78,4 +68,14 @@ bool count(const QStringList &args, State &state)
78 return true; 68 return true;
79} 69}
80 70
71Syntax::List syntax()
72{
73 Syntax::List syntax;
74 syntax << Syntax("count", QObject::tr("Returns the number of items of a given type in a resource. Usage: count <type> <resource>"), &AkonadiCount::count, Syntax::EventDriven);
75
76 return syntax;
77}
78
79REGISTER_SYNTAX(AkonadiCount)
80
81} 81}