mirror of
				https://github.com/SimpleMobileTools/Simple-File-Manager.git
				synced 2025-06-05 22:09:15 +02:00 
			
		
		
		
	do not count hidden items size if we are not showing them
This commit is contained in:
		@@ -16,7 +16,7 @@ import java.util.*
 | 
			
		||||
class PropertiesDialog() {
 | 
			
		||||
    lateinit var mContext: Context
 | 
			
		||||
    lateinit var mItem: FileDirItem
 | 
			
		||||
    private var mCountHiddenItems = false   // we always include the hidden item's size, counting items themselves is the optional thing
 | 
			
		||||
    private var mCountHiddenItems = false
 | 
			
		||||
    private var mFilesCnt = 0
 | 
			
		||||
 | 
			
		||||
    constructor(context: Context, item: FileDirItem, countHiddenItems: Boolean = false) : this() {
 | 
			
		||||
@@ -88,10 +88,9 @@ class PropertiesDialog() {
 | 
			
		||||
            for (i in files.indices) {
 | 
			
		||||
                if (files[i].isDirectory) {
 | 
			
		||||
                    size += getDirectorySize(files[i])
 | 
			
		||||
                } else {
 | 
			
		||||
                } else if (!files[i].isHidden && !dir.isHidden || mCountHiddenItems) {
 | 
			
		||||
                    mFilesCnt++
 | 
			
		||||
                    size += files[i].length()
 | 
			
		||||
                    if (!files[i].isHidden && !dir.isHidden || mCountHiddenItems)
 | 
			
		||||
                        mFilesCnt++
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return size
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user