From efbb9a602c380fafc8f969c3e323ce9e85935809 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 28 Dec 2017 11:26:45 +0100 Subject: Fixed incremental updates in folder queries Incremental additions of children in the tree were filtered due to the parent filter. This broke when we started to maintain state, thus causing the filter in datastorequery containing the parent filter to be carried over. Given that the incremental querying of children currently doesn't really add much value (we don't have trees that are large/deep enough), perhaps we're better off using a different approach. --- common/queryrunner.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'common') diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp index f196965..f3a9af8 100644 --- a/common/queryrunner.cpp +++ b/common/queryrunner.cpp @@ -245,23 +245,12 @@ ReplayResult QueryWorker::executeInitialQuery( QTime time; time.start(); - auto modifiedQuery = query; - if (!query.parentProperty().isEmpty()) { - if (parent) { - SinkTraceCtx(mLogCtx) << "Running initial query for parent:" << parent->identifier(); - modifiedQuery.filter(query.parentProperty(), Query::Comparator(QVariant::fromValue(Sink::ApplicationDomain::Reference{parent->identifier()}))); - } else { - SinkTraceCtx(mLogCtx) << "Running initial query for toplevel"; - modifiedQuery.filter(query.parentProperty(), Query::Comparator(QVariant{})); - } - } - auto entityStore = EntityStore{mResourceContext, mLogCtx}; auto preparedQuery = [&] { if (state) { return DataStoreQuery{*state, ApplicationDomain::getTypeName(), entityStore, false}; } else { - return DataStoreQuery{modifiedQuery, ApplicationDomain::getTypeName(), entityStore}; + return DataStoreQuery{query, ApplicationDomain::getTypeName(), entityStore}; } }(); auto resultSet = preparedQuery.execute(); -- cgit v1.2.3