Use oc:size instead of quota-used-bytes to get the sizes of folder (#4459)
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 11 Feb 2016 14:06:00 +0000 (15:06 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Thu, 11 Feb 2016 14:09:47 +0000 (15:09 +0100)
src/gui/folderstatusmodel.cpp
src/gui/selectivesyncdialog.cpp
src/gui/wizard/owncloudadvancedsetuppage.cpp
src/libsync/discoveryphase.cpp
src/libsync/networkjobs.cpp

index d45800d0fb30ebaa7a21df6f9ee22e763835967c..f4b06cf387bda514bd3f93ad9a4907de3e8b19cd 100644 (file)
@@ -517,7 +517,7 @@ void FolderStatusModel::fetchMore(const QModelIndex& parent)
         path += info->_path;
     }
     LsColJob *job = new LsColJob(_accountState->account(), path, this);
-    job->setProperties(QList<QByteArray>() << "resourcetype" << "quota-used-bytes");
+    job->setProperties(QList<QByteArray>() << "resourcetype" << "http://owncloud.org/ns:size");
     job->setTimeout(60 * 1000);
     connect(job, SIGNAL(directoryListingSubfolders(QStringList)),
             SLOT(slotUpdateDirectories(QStringList)));
index 1b693ed834f16b4d3682e82bd97c6ae8bf31d36a..ef3fb6c55f4c1442e64252be98de20ff408fab17 100644 (file)
@@ -81,7 +81,7 @@ QSize SelectiveSyncTreeView::sizeHint() const
 void SelectiveSyncTreeView::refreshFolders()
 {
     LsColJob *job = new LsColJob(_account, _folderPath, this);
-    job->setProperties(QList<QByteArray>() << "resourcetype" << "quota-used-bytes");
+    job->setProperties(QList<QByteArray>() << "resourcetype" << "http://owncloud.org/ns:size");
     connect(job, SIGNAL(directoryListingSubfolders(QStringList)),
             this, SLOT(slotUpdateDirectories(QStringList)));
     connect(job, SIGNAL(finishedWithError(QNetworkReply*)),
@@ -263,7 +263,7 @@ void SelectiveSyncTreeView::slotItemExpanded(QTreeWidgetItem *item)
         prefix = _folderPath + QLatin1Char('/');
     }
     LsColJob *job = new LsColJob(_account, prefix + dir, this);
-    job->setProperties(QList<QByteArray>() << "resourcetype" << "quota-used-bytes");
+    job->setProperties(QList<QByteArray>() << "resourcetype" << "http://owncloud.org/ns:size");
     connect(job, SIGNAL(directoryListingSubfolders(QStringList)),
             SLOT(slotUpdateDirectories(QStringList)));
     job->start();
index 9a64a98efe305d58ff8017938e9939a2a52d44e8..0142fa4eb8189aa0bbce10d054c91565470d7c80 100644 (file)
@@ -108,7 +108,7 @@ void OwncloudAdvancedSetupPage::initializePage()
 
     auto acc = static_cast<OwncloudWizard *>(wizard())->account();
     auto quotaJob = new PropfindJob(acc, _remoteFolder, this);
-    quotaJob->setProperties(QList<QByteArray>() << "quota-used-bytes");
+    quotaJob->setProperties(QList<QByteArray>() << "http://owncloud.org/ns:size");
 
     connect(quotaJob, SIGNAL(result(QVariantMap)), SLOT(slotQuotaRetrieved(QVariantMap)));
     quotaJob->start();
@@ -303,7 +303,7 @@ void OwncloudAdvancedSetupPage::slotSyncEverythingClicked()
 
 void OwncloudAdvancedSetupPage::slotQuotaRetrieved(const QVariantMap &result)
 {
-    _ui.lSyncEverythingSizeLabel->setText(tr("(%1)").arg(Utility::octetsToString(result["quota-used-bytes"].toDouble())));
+    _ui.lSyncEverythingSizeLabel->setText(tr("(%1)").arg(Utility::octetsToString(result["size"].toDouble())));
 
 }
 
index dd001584388adac590db196cfa56115ffd86c33e..29b4c223ea8f4f2c903bdfdc408c75ad8461d5e9 100644 (file)
@@ -485,7 +485,7 @@ void DiscoveryMainThread::doGetSizeSlot(const QString& path, qint64* result)
 
     // Schedule the DiscoverySingleDirectoryJob
     auto propfindJob = new PropfindJob(_account, fullPath, this);
-    propfindJob->setProperties(QList<QByteArray>() << "resourcetype" << "quota-used-bytes");
+    propfindJob->setProperties(QList<QByteArray>() << "resourcetype" << "http://owncloud.org/ns:size");
     QObject::connect(propfindJob, SIGNAL(finishedWithError()),
                      this, SLOT(slotGetSizeFinishedWithError()));
     QObject::connect(propfindJob, SIGNAL(result(QVariantMap)),
@@ -513,7 +513,7 @@ void DiscoveryMainThread::slotGetSizeResult(const QVariantMap &map)
         return; // possibly aborted
     }
 
-    *_currentGetSizeResult = map.value(QLatin1String("quota-used-bytes")).toLongLong();
+    *_currentGetSizeResult = map.value(QLatin1String("size")).toLongLong();
     qDebug() << "Size of folder:" << *_currentGetSizeResult;
     _currentGetSizeResult = 0;
     QMutexLocker locker(&_discoveryJob->_vioMutex);
index 5a51a4e4499355b10da14a17dc4ca63e482b8896..2bd924edf38ddf4b979445815d1f7c287c22a590 100644 (file)
@@ -208,7 +208,7 @@ bool LsColXMLParser::parse( const QByteArray& xml, QHash<QString, qint64> *sizes
             QString propertyContent = readContentsAsString(reader);
             if (name == QLatin1String("resourcetype") && propertyContent.contains("collection")) {
                 folders.append(currentHref);
-            } else if (name == QLatin1String("quota-used-bytes")) {
+            } else if (name == QLatin1String("size")) {
                 bool ok = false;
                 auto s = propertyContent.toLongLong(&ok);
                 if (ok && sizes) {