summaryrefslogtreecommitdiffstats
path: root/common/datastorequery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/datastorequery.cpp')
-rw-r--r--common/datastorequery.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp
index f56ac91..9f20ba9 100644
--- a/common/datastorequery.cpp
+++ b/common/datastorequery.cpp
@@ -298,7 +298,7 @@ public:
298 } 298 }
299}; 299};
300 300
301DataStoreQuery::DataStoreQuery(const Sink::Query &query, const QByteArray &type, EntityStore::Ptr store) 301DataStoreQuery::DataStoreQuery(const Sink::Query &query, const QByteArray &type, EntityStore &store)
302 : mQuery(query), mType(type), mStore(store) 302 : mQuery(query), mType(type), mStore(store)
303{ 303{
304 setupQuery(); 304 setupQuery();
@@ -306,12 +306,12 @@ DataStoreQuery::DataStoreQuery(const Sink::Query &query, const QByteArray &type,
306 306
307void DataStoreQuery::readEntity(const QByteArray &key, const BufferCallback &resultCallback) 307void DataStoreQuery::readEntity(const QByteArray &key, const BufferCallback &resultCallback)
308{ 308{
309 mStore->readLatest(mType, key, resultCallback); 309 mStore.readLatest(mType, key, resultCallback);
310} 310}
311 311
312QVector<QByteArray> DataStoreQuery::indexLookup(const QByteArray &property, const QVariant &value) 312QVector<QByteArray> DataStoreQuery::indexLookup(const QByteArray &property, const QVariant &value)
313{ 313{
314 return mStore->indexLookup(mType, property, value); 314 return mStore.indexLookup(mType, property, value);
315} 315}
316 316
317/* ResultSet DataStoreQuery::filterAndSortSet(ResultSet &resultSet, const FilterFunction &filter, const QByteArray &sortProperty) */ 317/* ResultSet DataStoreQuery::filterAndSortSet(ResultSet &resultSet, const FilterFunction &filter, const QByteArray &sortProperty) */
@@ -443,13 +443,13 @@ void DataStoreQuery::setupQuery()
443 } else { 443 } else {
444 QSet<QByteArray> appliedFilters; 444 QSet<QByteArray> appliedFilters;
445 445
446 auto resultSet = mStore->indexLookup(mType, mQuery, appliedFilters, appliedSorting); 446 auto resultSet = mStore.indexLookup(mType, mQuery, appliedFilters, appliedSorting);
447 remainingFilters = remainingFilters - appliedFilters; 447 remainingFilters = remainingFilters - appliedFilters;
448 448
449 // We do a full scan if there were no indexes available to create the initial set. 449 // We do a full scan if there were no indexes available to create the initial set.
450 if (appliedFilters.isEmpty()) { 450 if (appliedFilters.isEmpty()) {
451 // TODO this should be replaced by an index lookup on the uid index 451 // TODO this should be replaced by an index lookup on the uid index
452 mSource = Source::Ptr::create(mStore->fullScan(mType), this); 452 mSource = Source::Ptr::create(mStore.fullScan(mType), this);
453 } else { 453 } else {
454 mSource = Source::Ptr::create(resultSet, this); 454 mSource = Source::Ptr::create(resultSet, this);
455 } 455 }
@@ -492,7 +492,7 @@ QVector<QByteArray> DataStoreQuery::loadIncrementalResultSet(qint64 baseRevision
492{ 492{
493 auto revisionCounter = QSharedPointer<qint64>::create(baseRevision); 493 auto revisionCounter = QSharedPointer<qint64>::create(baseRevision);
494 QVector<QByteArray> changedKeys; 494 QVector<QByteArray> changedKeys;
495 mStore->readRevisions(baseRevision, mType, [&](const QByteArray &key) { 495 mStore.readRevisions(baseRevision, mType, [&](const QByteArray &key) {
496 changedKeys << key; 496 changedKeys << key;
497 }); 497 });
498 SinkTrace() << "Finished reading incremental result set:" << *revisionCounter; 498 SinkTrace() << "Finished reading incremental result set:" << *revisionCounter;