mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-13 17:38:32 +03:00
[CSE] Fix indentation
Parts of the code are indented by spaces, other parts by tabs. This needs to run in the whole codebase.
This commit is contained in:
parent
19120fde9f
commit
893ca66af8
1 changed files with 28 additions and 28 deletions
|
@ -1513,48 +1513,48 @@ bool GetFolderEncryptStatusJob::finished()
|
||||||
|
|
||||||
int http_result_code = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
int http_result_code = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||||
|
|
||||||
if (http_result_code == 207) {
|
if (http_result_code == 207) {
|
||||||
// Parse DAV response
|
// Parse DAV response
|
||||||
QXmlStreamReader reader(reply());
|
QXmlStreamReader reader(reply());
|
||||||
reader.addExtraNamespaceDeclaration(QXmlStreamNamespaceDeclaration("d", "DAV:"));
|
reader.addExtraNamespaceDeclaration(QXmlStreamNamespaceDeclaration("d", "DAV:"));
|
||||||
|
|
||||||
/* Example Xml
|
/* Example Xml
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
|
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
|
||||||
<d:response>
|
<d:response>
|
||||||
<d:href>/remote.php/webdav/</d:href>
|
<d:href>/remote.php/webdav/</d:href>
|
||||||
<d:propstat>
|
<d:propstat>
|
||||||
<d:prop>
|
<d:prop>
|
||||||
<nc:is-encrypted>0</nc:is-encrypted>
|
<nc:is-encrypted>0</nc:is-encrypted>
|
||||||
</d:prop>
|
</d:prop>
|
||||||
<d:status>HTTP/1.1 200 OK</d:status>
|
<d:status>HTTP/1.1 200 OK</d:status>
|
||||||
</d:propstat>
|
</d:propstat>
|
||||||
</d:response>
|
</d:response>
|
||||||
</d:multistatus>
|
</d:multistatus>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
QString currFile;
|
QString currFile;
|
||||||
int currEncryptedStatus = -1;
|
int currEncryptedStatus = -1;
|
||||||
QMap<QString, bool> folderStatus;
|
QMap<QString, bool> folderStatus;
|
||||||
while (!reader.atEnd()) {
|
while (!reader.atEnd()) {
|
||||||
auto type = reader.readNext();
|
auto type = reader.readNext();
|
||||||
if (type == QXmlStreamReader::StartElement) {
|
if (type == QXmlStreamReader::StartElement) {
|
||||||
if (reader.name() == QLatin1String("href")) {
|
if (reader.name() == QLatin1String("href")) {
|
||||||
// If the current file is not a folder, ignore it.
|
// If the current file is not a folder, ignore it.
|
||||||
currFile = reader.readElementText(QXmlStreamReader::SkipChildElements);
|
currFile = reader.readElementText(QXmlStreamReader::SkipChildElements);
|
||||||
if (!currFile.endsWith('/'))
|
if (!currFile.endsWith('/'))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (reader.name() == QLatin1String("is-encrypted")) {
|
if (reader.name() == QLatin1String("is-encrypted")) {
|
||||||
currEncryptedStatus = (bool) reader.readElementText(QXmlStreamReader::SkipChildElements).toInt();
|
currEncryptedStatus = (bool) reader.readElementText(QXmlStreamReader::SkipChildElements).toInt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currFile.isEmpty() && currEncryptedStatus != -1) {
|
if (!currFile.isEmpty() && currEncryptedStatus != -1) {
|
||||||
folderStatus.insert(currFile.remove("/remote.php/webdav/"), currEncryptedStatus);
|
folderStatus.insert(currFile.remove("/remote.php/webdav/"), currEncryptedStatus);
|
||||||
currFile.clear();
|
currFile.clear();
|
||||||
currEncryptedStatus = -1;
|
currEncryptedStatus = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit encryptStatusReceived(folderStatus);
|
emit encryptStatusReceived(folderStatus);
|
||||||
|
@ -1562,7 +1562,7 @@ bool GetFolderEncryptStatusJob::finished()
|
||||||
qCWarning(lcCse()) << "*not* successful, http result code is" << http_result_code
|
qCWarning(lcCse()) << "*not* successful, http result code is" << http_result_code
|
||||||
<< (http_result_code == 302 ? reply()->header(QNetworkRequest::LocationHeader).toString() : QLatin1String(""));
|
<< (http_result_code == 302 ? reply()->header(QNetworkRequest::LocationHeader).toString() : QLatin1String(""));
|
||||||
emit encryptStatusError(http_result_code);
|
emit encryptStatusError(http_result_code);
|
||||||
// emit finishedWithError(reply());
|
// emit finishedWithError(reply());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue