From ffecc3e4341102714a89ab6b5643c666c1feb0ee Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 30 Jan 2012 23:32:55 +0100 Subject: start of proper feedback during filessytem scan --- lib/filecache.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/filecache.php') diff --git a/lib/filecache.php b/lib/filecache.php index 928fc02e669..4e458ad929a 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -288,8 +288,9 @@ class OC_FileCache{ * recursively scan the filesystem and fill the cache * @param string $path * @param bool $onlyChilds + * @param OC_EventSource $enventSource */ - public static function scan($path,$onlyChilds=false){//PROBLEM due to the order things are added, all parents are -1 + public static function scan($path,$onlyChilds,$eventSource){//PROBLEM due to the order things are added, all parents are -1 $dh=OC_Filesystem::opendir($path); $stat=OC_Filesystem::stat($path); $mimetype=OC_Filesystem::getMimeType($path); @@ -305,12 +306,13 @@ class OC_FileCache{ if($filename != '.' and $filename != '..'){ $file=$path.'/'.$filename; if(OC_Filesystem::is_dir($file)){ - self::scan($file,true); + self::scan($file,true,$eventSource); }else{ $stat=OC_Filesystem::stat($file); $mimetype=OC_Filesystem::getMimeType($file); $stat['mimetype']=$mimetype; self::put($file,$stat); + $eventSource->send('scanned',$file); $totalSize+=$stat['size']; } } -- cgit v1.2.3