Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 416b0391 authored by tibbi's avatar tibbi
Browse files

properly fill FileDirItem at copy/move if it is empty

parent 4de4021e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.12.7'
        propVersionName = '3.12.8'
        kotlin_version = '1.2.21'
        support_libs = '27.0.2'
    }
+4 −1
Original line number Diff line number Diff line
@@ -60,11 +60,14 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal
        mNotifId = (System.currentTimeMillis() / 1000).toInt()
        mMaxSize = 0
        for (file in mFiles) {
            if (file.size == 0L) {
                file.size = file.getProperSize(activity, copyHidden)
            }
            val newPath = "${pair.second}/${file.name}"
            val fileExists = if (activity.isPathOnOTG(newPath)) activity.getFastDocumentFile(newPath)?.exists()
                    ?: false else File(newPath).exists()
            if (getConflictResolution(newPath) != CONFLICT_SKIP || !fileExists) {
                mMaxSize += (file.getProperSize(activity, copyHidden) / 1000).toInt()
                mMaxSize += (file.size / 1000).toInt()
            }
        }