diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-30 20:45:59 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-30 20:45:59 +0100 |
commit | 377c86144221ffc5b49bdaa9b8dcc3507fe4a50f (patch) | |
tree | b8025c51cf2c48d13106dbf9bb6192b080624ebd /common/queryrunner.cpp | |
parent | 412563b7ff18684f9786f4e40b1a4d538f2d5233 (diff) | |
download | sink-377c86144221ffc5b49bdaa9b8dcc3507fe4a50f.tar.gz sink-377c86144221ffc5b49bdaa9b8dcc3507fe4a50f.zip |
Fixed some warnings
Diffstat (limited to 'common/queryrunner.cpp')
-rw-r--r-- | common/queryrunner.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp index e365cfc..9f6d23f 100644 --- a/common/queryrunner.cpp +++ b/common/queryrunner.cpp | |||
@@ -53,27 +53,17 @@ static inline ResultSet fullScan(const Akonadi2::Storage::Transaction &transacti | |||
53 | template<class DomainType> | 53 | template<class DomainType> |
54 | QueryRunner<DomainType>::QueryRunner(const Akonadi2::Query &query, const Akonadi2::ResourceAccessInterface::Ptr &resourceAccess, const QByteArray &instanceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &factory, const QByteArray &bufferType) | 54 | QueryRunner<DomainType>::QueryRunner(const Akonadi2::Query &query, const Akonadi2::ResourceAccessInterface::Ptr &resourceAccess, const QByteArray &instanceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &factory, const QByteArray &bufferType) |
55 | : QueryRunnerBase(), | 55 | : QueryRunnerBase(), |
56 | mResourceAccess(resourceAccess), | ||
57 | mResultProvider(new ResultProvider<typename DomainType::Ptr>), | 56 | mResultProvider(new ResultProvider<typename DomainType::Ptr>), |
57 | mResourceAccess(resourceAccess), | ||
58 | mDomainTypeAdaptorFactory(factory), | 58 | mDomainTypeAdaptorFactory(factory), |
59 | mQuery(query), | ||
60 | mResourceInstanceIdentifier(instanceIdentifier), | 59 | mResourceInstanceIdentifier(instanceIdentifier), |
61 | mBufferType(bufferType) | 60 | mBufferType(bufferType), |
61 | mQuery(query) | ||
62 | { | 62 | { |
63 | Trace() << "Starting query"; | 63 | Trace() << "Starting query"; |
64 | //We delegate loading of initial data to the result provider, os it can decide for itself what it needs to load. | 64 | //We delegate loading of initial data to the result provider, os it can decide for itself what it needs to load. |
65 | mResultProvider->setFetcher([this, query](const typename DomainType::Ptr &parent) { | 65 | mResultProvider->setFetcher([this, query](const typename DomainType::Ptr &parent) { |
66 | Trace() << "Running fetcher"; | 66 | Trace() << "Running fetcher"; |
67 | |||
68 | // auto watcher = new QFutureWatcher<qint64>; | ||
69 | // QObject::connect(watcher, &QFutureWatcher::finished, [](qint64 newRevision) { | ||
70 | // mResourceAccess->sendRevisionReplayedCommand(newRevision); | ||
71 | // }); | ||
72 | // auto future = QtConcurrent::run([&resultProvider]() -> qint64 { | ||
73 | // const qint64 newRevision = executeInitialQuery(query, parent, resultProvider); | ||
74 | // return newRevision; | ||
75 | // }); | ||
76 | // watcher->setFuture(future); | ||
77 | const qint64 newRevision = executeInitialQuery(query, parent, *mResultProvider); | 67 | const qint64 newRevision = executeInitialQuery(query, parent, *mResultProvider); |
78 | mResourceAccess->sendRevisionReplayedCommand(newRevision); | 68 | mResourceAccess->sendRevisionReplayedCommand(newRevision); |
79 | }); | 69 | }); |
@@ -109,11 +99,9 @@ typename Akonadi2::ResultEmitter<typename DomainType::Ptr>::Ptr QueryRunner<Doma | |||
109 | return mResultProvider->emitter(); | 99 | return mResultProvider->emitter(); |
110 | } | 100 | } |
111 | 101 | ||
112 | //TODO move into result provider? | ||
113 | template<class DomainType> | 102 | template<class DomainType> |
114 | void QueryRunner<DomainType>::replaySet(ResultSet &resultSet, Akonadi2::ResultProviderInterface<typename DomainType::Ptr> &resultProvider) | 103 | void QueryRunner<DomainType>::replaySet(ResultSet &resultSet, Akonadi2::ResultProviderInterface<typename DomainType::Ptr> &resultProvider) |
115 | { | 104 | { |
116 | // Trace() << "Replay set"; | ||
117 | int counter = 0; | 105 | int counter = 0; |
118 | while (resultSet.next([&resultProvider, &counter](const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &value, Akonadi2::Operation operation) -> bool { | 106 | while (resultSet.next([&resultProvider, &counter](const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &value, Akonadi2::Operation operation) -> bool { |
119 | counter++; | 107 | counter++; |