Report size for directories in syncenginetestutils propfind response
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 18 Jul 2023 09:17:51 +0000 (17:17 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 4 Aug 2023 09:40:43 +0000 (17:40 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
test/syncenginetestutils.cpp

index 76617d7518ad91a9b23c46a4441c5abcc2c467d9..82aa701664d17d09cd0b4b59b79f8deed2fa78d5 100644 (file)
@@ -346,6 +346,12 @@ FakePropfindReply::FakePropfindReply(FileInfo &remoteRootFileInfo, QNetworkAcces
             xml.writeStartElement(davUri, QStringLiteral("resourcetype"));
             xml.writeEmptyElement(davUri, QStringLiteral("collection"));
             xml.writeEndElement(); // resourcetype
+
+            auto totalSize = 0;
+            for (const auto &child : fileInfo.children.values()) {
+                totalSize += child.size;
+            }
+            xml.writeTextElement(ocUri, QStringLiteral("size"), QString::number(totalSize));
         } else
             xml.writeEmptyElement(davUri, QStringLiteral("resourcetype"));