mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Get the etag of all subfolder for the root directory
The root directory etag is not updated when the files change. That's why we need to check the etag of all its sub items
This commit is contained in:
parent
5d24599546
commit
a9f23a8331
1 changed files with 9 additions and 2 deletions
|
@ -558,7 +558,14 @@ RequestEtagJob::RequestEtagJob(const QString& dir, QObject* parent)
|
|||
{
|
||||
QNetworkRequest req;
|
||||
req.setUrl( QUrl( ownCloudInfo::instance()->webdavUrl(ownCloudInfo::instance()->_connection) + dir ) );
|
||||
req.setRawHeader("Depth", "0");
|
||||
if (dir.isEmpty() || dir == "/") {
|
||||
/* For the root directory, we need to query the etags of all the sub directories
|
||||
* because, at the time I am writing this comment (Owncloud 5.0.9), the etag of the
|
||||
* root directory is not updated when the sub directories changes */
|
||||
req.setRawHeader("Depth", "1");
|
||||
} else {
|
||||
req.setRawHeader("Depth", "0");
|
||||
}
|
||||
QByteArray xml("<?xml version=\"1.0\" ?>\n"
|
||||
"<d:propfind xmlns:d=\"DAV:\">\n"
|
||||
" <d:prop>\n"
|
||||
|
@ -594,7 +601,7 @@ void RequestEtagJob::slotFinished()
|
|||
reader.namespaceUri() == QLatin1String("DAV:")) {
|
||||
QString name = reader.name().toString();
|
||||
if (name == QLatin1String("getetag")) {
|
||||
etag = reader.readElementText();
|
||||
etag += reader.readElementText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue