summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2013-08-27 06:40:39 -0700
committerBjörn Schießle <bjoern@schiessle.org>2013-08-27 06:40:39 -0700
commit38084aba2a755fdb5af4fb5bf6b90956e5fdb536 (patch)
tree9e458d9d13037aaf41b355287de85d54955a30bd
parent13514fd1adabc705c8e47cf48c0ce1f8a3b38181 (diff)
parent316d9bfed67ded313919f9d9f0c661013546f526 (diff)
downloadnextcloud-server-38084aba2a755fdb5af4fb5bf6b90956e5fdb536.tar.gz
nextcloud-server-38084aba2a755fdb5af4fb5bf6b90956e5fdb536.zip
Merge pull request #4596 from owncloud/fix_isEmpty_trash
trash bin: fix isEmpty() function
-rw-r--r--apps/files_trashbin/lib/trash.php9
1 files 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;
}