From 4878e824e5de723607c8091faf94933de38eb595 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 7 Dec 2017 19:04:12 +0100 Subject: [PATCH] [CSE] Fix reading encrypted status of folders. --- src/libsync/clientsideencryption.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index e95aaca2b..5e0b7ea79 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -1541,17 +1541,18 @@ bool GetFolderEncryptStatusJob::finished() if (type == QXmlStreamReader::StartElement) { if (reader.name() == QLatin1String("href")) { // If the current file is not a folder, ignore it. - currFile = reader.readElementText(QXmlStreamReader::SkipChildElements); + currFile = reader.readElementText(QXmlStreamReader::SkipChildElements).remove("/remote.php/webdav/"); if (!currFile.endsWith('/')) - continue; + currFile.clear(); + currEncryptedStatus = -1; } - if (reader.name() == QLatin1String("is-encrypted")) { + if (not currFile.isEmpty() && reader.name() == QLatin1String("is-encrypted")) { currEncryptedStatus = (bool) reader.readElementText(QXmlStreamReader::SkipChildElements).toInt(); } } if (!currFile.isEmpty() && currEncryptedStatus != -1) { - folderStatus.insert(currFile.remove("/remote.php/webdav/"), currEncryptedStatus); + folderStatus.insert(currFile, currEncryptedStatus); currFile.clear(); currEncryptedStatus = -1; }