]> source.dussan.org Git - nextcloud-server.git/commitdiff
the trash bin can also contain empty files. Don't use the trash bin size as indicator...
authorBjoern Schiessle <schiessle@owncloud.com>
Tue, 27 Aug 2013 12:39:43 +0000 (14:39 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Tue, 27 Aug 2013 12:39:43 +0000 (14:39 +0200)
apps/files_trashbin/lib/trash.php

index 323f25eac2fb5a65ce1bc8326994a417df31c135..0dcb2fc82e188ef6822ec6c838b72261e79a3199 100644 (file)
@@ -689,7 +689,7 @@ class Trashbin {
                        }
                }
        }
-       
+
        /**
         * clean up the trash bin
         * @param current size of the trash bin
@@ -892,16 +892,17 @@ class Trashbin {
                //Listen to post write hook
                \OCP\Util::connectHook('OC_Filesystem', 'post_write', "OCA\Files_Trashbin\Hooks", "post_write_hook");
        }
-       
+
        /**
         * @brief check if trash bin is empty for a given user
         * @param string $user
         */
        public static function isEmpty($user) {
 
-               $trashSize = self::getTrashbinSize($user);
+               $view = new \OC\Files\View('/' . $user . '/files_trashbin');
+               $content = $view->getDirectoryContent('/files');
 
-               if ($trashSize !== false && $trashSize > 0) {
+               if ($content) {
                        return false;
                }