diff options
author | Aaron Seigo <aseigo@kde.org> | 2015-12-24 16:23:46 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2015-12-24 16:23:46 +0100 |
commit | 8b397cec29460e2cb53b9be02b4e53da9cce60c9 (patch) | |
tree | 430191293848e5a8051a99a00634ea685c101d53 /akonadish/syntax_modules/akonadi_count.cpp | |
parent | b352f61f136f21854b3da5b76d49fe45cbb2d3fd (diff) | |
download | sink-8b397cec29460e2cb53b9be02b4e53da9cce60c9.tar.gz sink-8b397cec29460e2cb53b9be02b4e53da9cce60c9.zip |
bye-bye header files
the function-centric approach simply does not require them!
Diffstat (limited to 'akonadish/syntax_modules/akonadi_count.cpp')
-rw-r--r-- | akonadish/syntax_modules/akonadi_count.cpp | 24 |
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 | ||
39 | namespace AkonadiCount | 39 | namespace AkonadiCount |
40 | { | 40 | { |
41 | 41 | ||
42 | REGISTER_SYNTAX(AkonadiCount) | ||
43 | |||
44 | Syntax::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 | |||
52 | bool count(const QStringList &args, State &state) | 42 | bool 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 | ||
71 | Syntax::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 | |||
79 | REGISTER_SYNTAX(AkonadiCount) | ||
80 | |||
81 | } | 81 | } |