webdav quota now displays the same values as the web interface does

This commit is contained in:
Thomas Müller 2013-08-27 00:57:28 +02:00
parent 7d141656ee
commit 1e4ebf47e2
2 changed files with 6 additions and 6 deletions

View File

@ -233,10 +233,10 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
* @return array
*/
public function getQuotaInfo() {
$rootInfo=\OC\Files\Filesystem::getFileInfo('');
$storageInfo = OC_Helper::getStorageInfo($this->path);
return array(
$rootInfo['size'],
\OC\Files\Filesystem::free_space()
$storageInfo['used'],
$storageInfo['total']
);
}

View File

@ -843,13 +843,13 @@ class OC_Helper {
/**
* Calculate the disc space
*/
public static function getStorageInfo() {
$rootInfo = \OC\Files\Filesystem::getFileInfo('/');
public static function getStorageInfo($path = '/') {
$rootInfo = \OC\Files\Filesystem::getFileInfo($path);
$used = $rootInfo['size'];
if ($used < 0) {
$used = 0;
}
$free = \OC\Files\Filesystem::free_space();
$free = \OC\Files\Filesystem::free_space($path);
if ($free >= 0) {
$total = $free + $used;
} else {