Skip to content
Snippets Groups Projects
Commit 1e4ebf47 authored by Thomas Müller's avatar Thomas Müller
Browse files

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

parent 7d141656
Branches
No related tags found
No related merge requests found
...@@ -233,10 +233,10 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa ...@@ -233,10 +233,10 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
* @return array * @return array
*/ */
public function getQuotaInfo() { public function getQuotaInfo() {
$rootInfo=\OC\Files\Filesystem::getFileInfo(''); $storageInfo = OC_Helper::getStorageInfo($this->path);
return array( return array(
$rootInfo['size'], $storageInfo['used'],
\OC\Files\Filesystem::free_space() $storageInfo['total']
); );
} }
......
...@@ -843,13 +843,13 @@ class OC_Helper { ...@@ -843,13 +843,13 @@ class OC_Helper {
/** /**
* Calculate the disc space * Calculate the disc space
*/ */
public static function getStorageInfo() { public static function getStorageInfo($path = '/') {
$rootInfo = \OC\Files\Filesystem::getFileInfo('/'); $rootInfo = \OC\Files\Filesystem::getFileInfo($path);
$used = $rootInfo['size']; $used = $rootInfo['size'];
if ($used < 0) { if ($used < 0) {
$used = 0; $used = 0;
} }
$free = \OC\Files\Filesystem::free_space(); $free = \OC\Files\Filesystem::free_space($path);
if ($free >= 0) { if ($free >= 0) {
$total = $free + $used; $total = $free + $used;
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment