summaryrefslogtreecommitdiffstats
path: root/common/modelresult.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/modelresult.h')
-rw-r--r--common/modelresult.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/common/modelresult.h b/common/modelresult.h
index 1675e60..26f96d8 100644
--- a/common/modelresult.h
+++ b/common/modelresult.h
@@ -179,20 +179,11 @@ public:
179 { 179 {
180 const auto id = getIdentifier(parent); 180 const auto id = getIdentifier(parent);
181 mEntityChildrenFetched[id] = true; 181 mEntityChildrenFetched[id] = true;
182 QByteArray parentIdentifier; 182 Trace() << "Loading child entities";
183 if (!parent.isValid()) { 183 loadEntities(parent.data(DomainObjectRole).template value<Ptr>());
184 qDebug() << "no parent";
185 } else {
186 qDebug() << "parent is valid";
187 auto object = parent.data(DomainObjectRole).template value<Ptr>();
188 Q_ASSERT(object);
189 parentIdentifier = object->identifier();
190 }
191 Trace() << "Loading child entities of: " << parentIdentifier;
192 loadEntities(parentIdentifier);
193 } 184 }
194 185
195 void setFetcher(const std::function<void(const QByteArray &parent)> &fetcher) 186 void setFetcher(const std::function<void(const Ptr &parent)> &fetcher)
196 { 187 {
197 Trace() << "Setting fetcher"; 188 Trace() << "Setting fetcher";
198 loadEntities = fetcher; 189 loadEntities = fetcher;
@@ -206,6 +197,6 @@ private:
206 QMap<qint64 /* entity id */, bool> mEntityChildrenFetched; 197 QMap<qint64 /* entity id */, bool> mEntityChildrenFetched;
207 QList<QByteArray> mPropertyColumns; 198 QList<QByteArray> mPropertyColumns;
208 Akonadi2::Query mQuery; 199 Akonadi2::Query mQuery;
209 std::function<void(const QByteArray &)> loadEntities; 200 std::function<void(const Ptr &)> loadEntities;
210}; 201};
211 202