diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-19 18:14:09 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-19 18:14:09 +0100 |
commit | c4a6746e4420b580fe35cc89783de4dbc3205ac6 (patch) | |
tree | e58905f13653d44671ca0e88388f83d26c5a3a28 /common/modelresult.h | |
parent | 8d5684292ef92f32487ba32df716a00c4a0841b5 (diff) | |
download | sink-c4a6746e4420b580fe35cc89783de4dbc3205ac6.tar.gz sink-c4a6746e4420b580fe35cc89783de4dbc3205ac6.zip |
The parent is always an object, so we might as well make that explicit
Diffstat (limited to 'common/modelresult.h')
-rw-r--r-- | common/modelresult.h | 17 |
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 | ||