From f3797abecfd90d8b8a068256aa9bbcda1f3ff3da Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 14 Nov 2014 15:03:48 +0100 Subject: [PATCH] Fix the PropfindJob -the namespace mangling was wrong -And the way we read the reply did not work --- src/libsync/networkjobs.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp index 5271616dbb..78179aa685 100644 --- a/src/libsync/networkjobs.cpp +++ b/src/libsync/networkjobs.cpp @@ -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 += " \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 {