From 316d9bfed67ded313919f9d9f0c661013546f526 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Tue, 27 Aug 2013 14:39:43 +0200 Subject: [PATCH] the trash bin can also contain empty files. Don't use the trash bin size as indicator to decide if the trash bin is empty or not --- apps/files_trashbin/lib/trash.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 323f25eac2f..0dcb2fc82e1 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -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; } -- 2.39.5