diff options
Diffstat (limited to 'apps/files_trashbin/lib/trash.php')
-rw-r--r-- | apps/files_trashbin/lib/trash.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index fe2b8e5cd79..c79afdc0c2e 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -72,11 +72,6 @@ class Trashbin { $mime = $view->getMimeType('files' . $file_path); if ($view->is_dir('files' . $file_path)) { - $dirContent = $view->getDirectoryContent('files' . $file_path); - // no need to move empty folders to the trash bin - if (empty($dirContent)) { - return true; - } $type = 'dir'; } else { $type = 'file'; @@ -689,7 +684,7 @@ class Trashbin { } } } - + /** * clean up the trash bin * @param current size of the trash bin @@ -892,16 +887,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; } |