mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Fix the PropfindJob
-the namespace mangling was wrong -And the way we read the reply did not work
This commit is contained in:
parent
1310bef528
commit
f3797abecf
@ -498,7 +498,8 @@ void PropfindJob::start()
|
||||
QByteArray propStr;
|
||||
foreach (const QByteArray &prop, properties) {
|
||||
if (prop.contains(':')) {
|
||||
propStr += " <" + prop + " />\n";
|
||||
int colIdx = prop.lastIndexOf(":");
|
||||
propStr += " <" + prop.mid(colIdx+1) + " xmlns=\"" + prop.left(colIdx) + "\" />\n";
|
||||
} else {
|
||||
propStr += " <d:" + prop + " />\n";
|
||||
}
|
||||
@ -545,17 +546,16 @@ bool PropfindJob::finished()
|
||||
while (!reader.atEnd()) {
|
||||
QXmlStreamReader::TokenType type = reader.readNext();
|
||||
if (type == QXmlStreamReader::StartElement) {
|
||||
if (curElement.isEmpty()) {
|
||||
curElement.push(reader.name().toString());
|
||||
items.insert(reader.name().toString(), reader.text().toString());
|
||||
if (!curElement.isEmpty() && curElement.top() == QLatin1String("prop")) {
|
||||
items.insert(reader.name().toString(), reader.readElementText());
|
||||
}
|
||||
curElement.push(reader.name().toString());
|
||||
}
|
||||
if (type == QXmlStreamReader::EndElement) {
|
||||
if(curElement.top() == reader.name()) {
|
||||
curElement.pop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
emit result(items);
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user