From e06e04ee933dcb739bc23d70ba5fffa4b9b9a021 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Fri, 29 Dec 2017 09:43:27 -0200 Subject: [PATCH] Fix parsing list of encrypted folders --- src/libsync/clientsideencryptionjobs.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libsync/clientsideencryptionjobs.cpp b/src/libsync/clientsideencryptionjobs.cpp index eaa012365e..539ab9bebc 100644 --- a/src/libsync/clientsideencryptionjobs.cpp +++ b/src/libsync/clientsideencryptionjobs.cpp @@ -81,10 +81,15 @@ bool GetFolderEncryptStatusJob::finished() auto type = reader.readNext(); if (type == QXmlStreamReader::StartElement) { if (reader.name() == QLatin1String("href")) { - // If the current file is not a folder, ignore it. - currFile = reader.readElementText(QXmlStreamReader::SkipChildElements).remove("/remote.php/webdav/"); - if (!currFile.endsWith('/')) - currFile.clear(); + // If the current file is not a folder, ignore it. + QString base = account()->url().path(); + if (base.endsWith(QLatin1Char('/'))) + base.chop(1); + + currFile = reader.readElementText(QXmlStreamReader::SkipChildElements); + currFile.remove(base + QLatin1String("/remote.php/webdav/")); + if (!currFile.endsWith('/')) + currFile.clear(); currEncryptedStatus = -1; } if (not currFile.isEmpty() && reader.name() == QLatin1String("is-encrypted")) {