diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-26 11:27:34 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-26 11:27:34 +0200 |
commit | 3db36de42fc986341b0fac8c4cbfe869f0bac356 (patch) | |
tree | 20530c2bff144e835f0e40fc6bacb64d81b10c22 /sinksh/sinksh_utils.h | |
parent | d993e357e03549c731d724f199ef55e7bcf7e1b2 (diff) | |
download | sink-3db36de42fc986341b0fac8c4cbfe869f0bac356.tar.gz sink-3db36de42fc986341b0fac8c4cbfe869f0bac356.zip |
Ported sinksh list to synchronous API (which also fixed it)
Diffstat (limited to 'sinksh/sinksh_utils.h')
-rw-r--r-- | sinksh/sinksh_utils.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sinksh/sinksh_utils.h b/sinksh/sinksh_utils.h index 5f470ff..b5b6f3c 100644 --- a/sinksh/sinksh_utils.h +++ b/sinksh/sinksh_utils.h | |||
@@ -35,6 +35,7 @@ class StoreBase; | |||
35 | bool isValidStoreType(const QString &type); | 35 | bool isValidStoreType(const QString &type); |
36 | StoreBase &getStore(const QString &type); | 36 | StoreBase &getStore(const QString &type); |
37 | QSharedPointer<QAbstractItemModel> loadModel(const QString &type, Sink::Query query); | 37 | QSharedPointer<QAbstractItemModel> loadModel(const QString &type, Sink::Query query); |
38 | QList<QByteArray> requestedProperties(const QString &type); | ||
38 | QStringList resourceIds(); | 39 | QStringList resourceIds(); |
39 | QStringList resourceCompleter(const QStringList &, const QString &fragment, State &state); | 40 | QStringList resourceCompleter(const QStringList &, const QString &fragment, State &state); |
40 | QStringList resourceOrTypeCompleter(const QStringList &commands, const QString &fragment, State &state); | 41 | QStringList resourceOrTypeCompleter(const QStringList &commands, const QString &fragment, State &state); |
@@ -54,6 +55,7 @@ public: | |||
54 | virtual KAsync::Job<void> modify(const Sink::ApplicationDomain::ApplicationDomainType &type) = 0; | 55 | virtual KAsync::Job<void> modify(const Sink::ApplicationDomain::ApplicationDomainType &type) = 0; |
55 | virtual KAsync::Job<void> remove(const Sink::ApplicationDomain::ApplicationDomainType &type) = 0; | 56 | virtual KAsync::Job<void> remove(const Sink::ApplicationDomain::ApplicationDomainType &type) = 0; |
56 | virtual QSharedPointer<QAbstractItemModel> loadModel(const Sink::Query &query) = 0; | 57 | virtual QSharedPointer<QAbstractItemModel> loadModel(const Sink::Query &query) = 0; |
58 | virtual QList<Sink::ApplicationDomain::ApplicationDomainType> read(const Sink::Query &query) = 0; | ||
57 | }; | 59 | }; |
58 | 60 | ||
59 | template <typename T> | 61 | template <typename T> |
@@ -89,5 +91,14 @@ public: | |||
89 | { | 91 | { |
90 | return Sink::Store::loadModel<T>(query); | 92 | return Sink::Store::loadModel<T>(query); |
91 | } | 93 | } |
94 | |||
95 | QList<Sink::ApplicationDomain::ApplicationDomainType> read(const Sink::Query &query) Q_DECL_OVERRIDE | ||
96 | { | ||
97 | QList<Sink::ApplicationDomain::ApplicationDomainType> list; | ||
98 | for (const auto &o : Sink::Store::read<T>(query)) { | ||
99 | list << o; | ||
100 | } | ||
101 | return list; | ||
102 | } | ||
92 | }; | 103 | }; |
93 | } | 104 | } |