diff options
author | Aaron Seigo <aseigo@kde.org> | 2015-12-28 20:26:44 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2015-12-28 20:26:44 +0100 |
commit | 67d664f6dc36e3bd85fac27d5008b84e4b1d5568 (patch) | |
tree | 4531552f185e7a563ca302d0d4c462c215a0f94a /akonadish/syntax_modules | |
parent | 7b380e9677678c0e3bcec981a2466ccb04f4e590 (diff) | |
download | sink-67d664f6dc36e3bd85fac27d5008b84e4b1d5568.tar.gz sink-67d664f6dc36e3bd85fac27d5008b84e4b1d5568.zip |
resource automcompletion
Diffstat (limited to 'akonadish/syntax_modules')
-rw-r--r-- | akonadish/syntax_modules/akonadi_clear.cpp | 6 | ||||
-rw-r--r-- | akonadish/syntax_modules/akonadi_count.cpp | 6 | ||||
-rw-r--r-- | akonadish/syntax_modules/akonadi_modify.cpp | 9 | ||||
-rw-r--r-- | akonadish/syntax_modules/akonadi_remove.cpp | 9 | ||||
-rw-r--r-- | akonadish/syntax_modules/akonadi_stat.cpp | 6 | ||||
-rw-r--r-- | akonadish/syntax_modules/akonadi_sync.cpp | 6 |
6 files changed, 20 insertions, 22 deletions
diff --git a/akonadish/syntax_modules/akonadi_clear.cpp b/akonadish/syntax_modules/akonadi_clear.cpp index d17fac2..d328849 100644 --- a/akonadish/syntax_modules/akonadi_clear.cpp +++ b/akonadish/syntax_modules/akonadi_clear.cpp | |||
@@ -50,10 +50,10 @@ bool clear(const QStringList &args, State &state) | |||
50 | 50 | ||
51 | Syntax::List syntax() | 51 | Syntax::List syntax() |
52 | { | 52 | { |
53 | Syntax::List syntax; | 53 | Syntax clear("clear", QObject::tr("Clears the local cache of one or more resources (be careful!)"), &AkonadiClear::clear); |
54 | syntax << Syntax("clear", QObject::tr("Clears the local cache of one or more resources (be careful!)"), &AkonadiClear::clear); | 54 | clear.completer = &AkonadishUtils::resourceCompleter; |
55 | 55 | ||
56 | return syntax; | 56 | return Syntax::List() << clear; |
57 | } | 57 | } |
58 | 58 | ||
59 | REGISTER_SYNTAX(AkonadiClear) | 59 | REGISTER_SYNTAX(AkonadiClear) |
diff --git a/akonadish/syntax_modules/akonadi_count.cpp b/akonadish/syntax_modules/akonadi_count.cpp index cda7235..fa3f1fb 100644 --- a/akonadish/syntax_modules/akonadi_count.cpp +++ b/akonadish/syntax_modules/akonadi_count.cpp | |||
@@ -74,10 +74,10 @@ bool count(const QStringList &args, State &state) | |||
74 | 74 | ||
75 | Syntax::List syntax() | 75 | Syntax::List syntax() |
76 | { | 76 | { |
77 | Syntax::List syntax; | 77 | Syntax count("count", QObject::tr("Returns the number of items of a given type in a resource. Usage: count <type> <resource>"), &AkonadiCount::count, Syntax::EventDriven); |
78 | 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); | 78 | count.completer = &AkonadishUtils::resourceCompleter; |
79 | 79 | ||
80 | return syntax; | 80 | return Syntax::List() << count; |
81 | } | 81 | } |
82 | 82 | ||
83 | REGISTER_SYNTAX(AkonadiCount) | 83 | REGISTER_SYNTAX(AkonadiCount) |
diff --git a/akonadish/syntax_modules/akonadi_modify.cpp b/akonadish/syntax_modules/akonadi_modify.cpp index 8438301..8ab873a 100644 --- a/akonadish/syntax_modules/akonadi_modify.cpp +++ b/akonadish/syntax_modules/akonadi_modify.cpp | |||
@@ -107,13 +107,12 @@ bool resource(const QStringList &args, State &state) | |||
107 | 107 | ||
108 | Syntax::List syntax() | 108 | Syntax::List syntax() |
109 | { | 109 | { |
110 | Syntax::List syntax; | ||
111 | |||
112 | Syntax modify("modify", QObject::tr("Modify items in a resource"), &AkonadiModify::modify); | 110 | Syntax modify("modify", QObject::tr("Modify items in a resource"), &AkonadiModify::modify); |
113 | modify.children << Syntax("resource", QObject::tr("Modify a resource"), &AkonadiModify::resource);//, Syntax::EventDriven); | 111 | Syntax resource("resource", QObject::tr("Modify a resource"), &AkonadiModify::resource);//, Syntax::EventDriven); |
112 | resource.completer = &AkonadishUtils::resourceCompleter; | ||
113 | modify.children << resource; | ||
114 | 114 | ||
115 | syntax << modify; | 115 | return Syntax::List() << modify; |
116 | return syntax; | ||
117 | } | 116 | } |
118 | 117 | ||
119 | REGISTER_SYNTAX(AkonadiModify) | 118 | REGISTER_SYNTAX(AkonadiModify) |
diff --git a/akonadish/syntax_modules/akonadi_remove.cpp b/akonadish/syntax_modules/akonadi_remove.cpp index bf09e2e..9691d78 100644 --- a/akonadish/syntax_modules/akonadi_remove.cpp +++ b/akonadish/syntax_modules/akonadi_remove.cpp | |||
@@ -97,13 +97,12 @@ bool resource(const QStringList &args, State &state) | |||
97 | 97 | ||
98 | Syntax::List syntax() | 98 | Syntax::List syntax() |
99 | { | 99 | { |
100 | Syntax::List syntax; | ||
101 | |||
102 | Syntax remove("remove", QObject::tr("Remove items in a resource"), &AkonadiRemove::remove); | 100 | Syntax remove("remove", QObject::tr("Remove items in a resource"), &AkonadiRemove::remove); |
103 | remove.children << Syntax("resource", QObject::tr("Removes a resource"), &AkonadiRemove::resource);//, Syntax::EventDriven); | 101 | Syntax resource("resource", QObject::tr("Removes a resource"), &AkonadiRemove::resource);//, Syntax::EventDriven); |
102 | resource.completer = &AkonadishUtils::resourceCompleter; | ||
103 | remove.children << resource; | ||
104 | 104 | ||
105 | syntax << remove; | 105 | return Syntax::List() << remove; |
106 | return syntax; | ||
107 | } | 106 | } |
108 | 107 | ||
109 | REGISTER_SYNTAX(AkonadiRemove) | 108 | REGISTER_SYNTAX(AkonadiRemove) |
diff --git a/akonadish/syntax_modules/akonadi_stat.cpp b/akonadish/syntax_modules/akonadi_stat.cpp index 0ea65dd..9270f9d 100644 --- a/akonadish/syntax_modules/akonadi_stat.cpp +++ b/akonadish/syntax_modules/akonadi_stat.cpp | |||
@@ -111,10 +111,10 @@ bool stat(const QStringList &args, State &state) | |||
111 | 111 | ||
112 | Syntax::List syntax() | 112 | Syntax::List syntax() |
113 | { | 113 | { |
114 | Syntax::List syntax; | 114 | Syntax state("stat", QObject::tr("Shows database usage for the resources requested"), &AkonadiStat::stat, Syntax::EventDriven); |
115 | syntax << Syntax("stat", QObject::tr("Shows database usage for the resources requested"), &AkonadiStat::stat, Syntax::EventDriven); | 115 | state.completer = &AkonadishUtils::resourceCompleter; |
116 | 116 | ||
117 | return syntax; | 117 | return Syntax::List() << state; |
118 | } | 118 | } |
119 | 119 | ||
120 | REGISTER_SYNTAX(AkonadiStat) | 120 | REGISTER_SYNTAX(AkonadiStat) |
diff --git a/akonadish/syntax_modules/akonadi_sync.cpp b/akonadish/syntax_modules/akonadi_sync.cpp index 1cf097d..03abbb4 100644 --- a/akonadish/syntax_modules/akonadi_sync.cpp +++ b/akonadish/syntax_modules/akonadi_sync.cpp | |||
@@ -58,10 +58,10 @@ bool sync(const QStringList &args, State &state) | |||
58 | 58 | ||
59 | Syntax::List syntax() | 59 | Syntax::List syntax() |
60 | { | 60 | { |
61 | Syntax::List syntax; | 61 | Syntax sync("sync", QObject::tr("Syncronizes all resources that are listed; and empty list triggers a syncronizaton on all resources"), &AkonadiSync::sync, Syntax::EventDriven ); |
62 | syntax << Syntax("sync", QObject::tr("Syncronizes all resources that are listed; and empty list triggers a syncronizaton on all resources"), &AkonadiSync::sync, Syntax::EventDriven ); | 62 | sync.completer = &AkonadishUtils::resourceCompleter; |
63 | 63 | ||
64 | return syntax; | 64 | return Syntax::List() << sync; |
65 | } | 65 | } |
66 | 66 | ||
67 | REGISTER_SYNTAX(AkonadiSync) | 67 | REGISTER_SYNTAX(AkonadiSync) |