]> source.dussan.org Git - nextcloud-server.git/commitdiff
webdav quota now displays the same values as the web interface does
authorThomas Müller <thomas.mueller@tmit.eu>
Mon, 26 Aug 2013 22:57:28 +0000 (00:57 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Mon, 26 Aug 2013 22:57:28 +0000 (00:57 +0200)
lib/connector/sabre/directory.php
lib/helper.php

index ed8d085462d552ef5b3b6cf315d4647e808a8dcc..66cd2fcd4e3b6beaec89116024f641062f2ea3a4 100644 (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']
                );
 
        }
index c7687d431e1d937208600c1f6d732105f8600605..128786087b8e6424a20a8ee2c8d72eba7923ff85 100644 (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 {