From ae4b64b198a143240aa5dd1e202e5016abfdae71 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 8 Dec 2016 13:18:19 +0100 Subject: Wrap references in a Reerence type. This allows us to make sure that references are not taken out of context (the resource). Because we need to use the type-specific accessors more we also ran into a problem that we cannot "downcast" a reference with the change recording still working, for that we have the cast() operator now. --- common/queryrunner.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common/queryrunner.cpp') diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp index cf56268..d6a90de 100644 --- a/common/queryrunner.cpp +++ b/common/queryrunner.cpp @@ -224,15 +224,15 @@ QPair QueryWorker::executeInitialQuery( if (!query.parentProperty().isEmpty()) { if (parent) { SinkTrace() << "Running initial query for parent:" << parent->identifier(); - modifiedQuery.filter(query.parentProperty(), Query::Comparator(parent->identifier())); + modifiedQuery.filter(query.parentProperty(), Query::Comparator(QVariant::fromValue(Sink::ApplicationDomain::Reference{parent->identifier()}))); } else { SinkTrace() << "Running initial query for toplevel"; - modifiedQuery.filter(query.parentProperty(), Query::Comparator(QVariant())); + modifiedQuery.filter(query.parentProperty(), Query::Comparator(QVariant{})); } } auto entityStore = EntityStore{mResourceContext}; - auto preparedQuery = DataStoreQuery{query, ApplicationDomain::getTypeName(), entityStore}; + auto preparedQuery = DataStoreQuery{modifiedQuery, ApplicationDomain::getTypeName(), entityStore}; auto resultSet = preparedQuery.execute(); SinkTrace() << "Filtered set retrieved. " << Log::TraceTime(time.elapsed()); -- cgit v1.2.3