Changeset View
Changeset View
Standalone View
Standalone View
src/core/protocolhelper.cpp
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 127 | { | |||
---|---|---|---|---|---|
129 | parseAncestors(ancestors, &fakeCollection); | 129 | parseAncestors(ancestors, &fakeCollection); | ||
130 | 130 | | |||
131 | item->setParentCollection(fakeCollection.parentCollection()); | 131 | item->setParentCollection(fakeCollection.parentCollection()); | ||
132 | } | 132 | } | ||
133 | 133 | | |||
134 | void ProtocolHelper::parseAncestors(const QVector<Protocol::Ancestor> &ancestors, Collection *collection) | 134 | void ProtocolHelper::parseAncestors(const QVector<Protocol::Ancestor> &ancestors, Collection *collection) | ||
135 | { | 135 | { | ||
136 | static const Collection::Id rootCollectionId = Collection::root().id(); | 136 | static const Collection::Id rootCollectionId = Collection::root().id(); | ||
137 | QList<QByteArray> parentIds; | | |||
138 | 137 | | |||
139 | Collection *current = collection; | 138 | Collection *current = collection; | ||
140 | for (const Protocol::Ancestor &ancestor : ancestors) { | 139 | for (const Protocol::Ancestor &ancestor : ancestors) { | ||
141 | if (ancestor.id() == rootCollectionId) { | 140 | if (ancestor.id() == rootCollectionId) { | ||
142 | current->setParentCollection(Collection::root()); | 141 | current->setParentCollection(Collection::root()); | ||
143 | break; | 142 | break; | ||
144 | } | 143 | } | ||
145 | 144 | | |||
▲ Show 20 Lines • Show All 393 Lines • ▼ Show 20 Line(s) | 536 | case Protocol::CollectionFetchScope::Parent: | |||
539 | break; | 538 | break; | ||
540 | case Protocol::CollectionFetchScope::All: | 539 | case Protocol::CollectionFetchScope::All: | ||
541 | cfs.setAncestorRetrieval(CollectionFetchScope::All); | 540 | cfs.setAncestorRetrieval(CollectionFetchScope::All); | ||
542 | break; | 541 | break; | ||
543 | } | 542 | } | ||
544 | if (cfs.ancestorRetrieval() != CollectionFetchScope::None) { | 543 | if (cfs.ancestorRetrieval() != CollectionFetchScope::None) { | ||
545 | cfs.ancestorFetchScope().setFetchIdOnly(fetchScope.ancestorFetchIdOnly()); | 544 | cfs.ancestorFetchScope().setFetchIdOnly(fetchScope.ancestorFetchIdOnly()); | ||
546 | const auto attrs = fetchScope.ancestorAttributes(); | 545 | const auto attrs = fetchScope.ancestorAttributes(); | ||
547 | for (const auto attr : attrs) { | 546 | for (const auto &attr : attrs) { | ||
548 | cfs.ancestorFetchScope().fetchAttribute(attr, true); | 547 | cfs.ancestorFetchScope().fetchAttribute(attr, true); | ||
549 | } | 548 | } | ||
550 | } | 549 | } | ||
551 | const auto attrs = fetchScope.attributes(); | 550 | const auto attrs = fetchScope.attributes(); | ||
552 | for (const auto &attr : attrs) { | 551 | for (const auto &attr : attrs) { | ||
553 | cfs.fetchAttribute(attr, true); | 552 | cfs.fetchAttribute(attr, true); | ||
554 | } | 553 | } | ||
555 | cfs.setFetchIdOnly(fetchScope.fetchIdOnly()); | 554 | cfs.setFetchIdOnly(fetchScope.fetchIdOnly()); | ||
▲ Show 20 Lines • Show All 230 Lines • Show Last 20 Lines |