const auto propChildElementTagName = propChildElement.tagName();
if (propChildElementTagName == propfindFileTagsContainerElementTagName) {
- const auto tagNodes = domDocument.elementsByTagName(propfindFileTagElementTagName);
- const auto tagCount = tagNodes.count();
-
- auto tagList = QStringList();
- tagList.reserve(tagCount);
-
- for (auto i = 0; i < tagCount; ++i) {
- const auto tagNode = tagNodes.at(i);
- const auto tagElement = tagNode.toElement();
-
- if (tagElement.isNull()) {
- continue;
- }
-
- tagList.append(tagElement.text());
- }
-
+ const auto tagList = processTagsInPropfindDomDocument(domDocument);
items.insert(propChildElementTagName, tagList);
-
} else {
items.insert(propChildElementTagName, propChildElement.text());
}
return items;
}
+QStringList PropfindJob::processTagsInPropfindDomDocument(const QDomDocument &domDocument)
+{
+ const auto tagNodes = domDocument.elementsByTagName(propfindFileTagElementTagName);
+ if (tagNodes.isEmpty()) {
+ return {};
+ }
+
+ const auto tagCount = tagNodes.count();
+ auto tagList = QStringList();
+ tagList.reserve(tagCount);
+
+ for (auto i = 0; i < tagCount; ++i) {
+ const auto tagNode = tagNodes.at(i);
+ const auto tagElement = tagNode.toElement();
+
+ if (tagElement.isNull()) {
+ continue;
+ }
+
+ tagList.append(tagElement.text());
+ }
+
+ return tagList;
+}
+
/*********************************************************************************************/
#ifndef TOKEN_AUTH_ONLY