optimize temporary folder adding a bit

This commit is contained in:
tibbi 2019-05-09 12:08:14 +02:00
parent 12cb855c3a
commit 640ff05e20

View file

@ -471,14 +471,16 @@ fun Context.loadImage(type: Int, path: String, target: MySquareImageView, horizo
}
fun Context.addTempFolderIfNeeded(dirs: ArrayList<Directory>): ArrayList<Directory> {
val directories = ArrayList<Directory>()
val tempFolderPath = config.tempFolderPath
if (tempFolderPath.isNotEmpty()) {
return if (tempFolderPath.isNotEmpty()) {
val directories = ArrayList<Directory>()
val newFolder = Directory(null, tempFolderPath, "", tempFolderPath.getFilenameFromPath(), 0, 0, 0, 0L, getPathLocation(tempFolderPath), 0)
directories.add(newFolder)
}
directories.addAll(dirs)
return directories
directories
} else {
dirs
}
}
fun Context.getPathLocation(path: String): Int {