remove a redundant variable

This commit is contained in:
tibbi 2016-12-05 23:21:06 +01:00
parent d0e81a3410
commit 3d6329766a
2 changed files with 3 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import com.simplemobiletools.filepicker.extensions.scanFiles
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.extensions.getHumanizedFilename
import com.simplemobiletools.gallery.extensions.getLongValue
import com.simplemobiletools.gallery.extensions.getStringValue
import com.simplemobiletools.gallery.helpers.Config
import com.simplemobiletools.gallery.helpers.SORT_BY_NAME
import com.simplemobiletools.gallery.helpers.SORT_DESCENDING
@ -46,9 +47,8 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
cursor = context.contentResolver.query(uri, columns, null, null, order)
if (cursor?.moveToFirst() == true) {
val pathIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA)
do {
val fullPath = cursor.getString(pathIndex) ?: continue
val fullPath = cursor.getStringValue(MediaStore.Images.Media.DATA) ?: continue
val file = File(fullPath)
val size = cursor.getLongValue(MediaStore.Images.Media.SIZE)

View File

@ -46,9 +46,8 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickVideo
cursor = context.contentResolver.query(uri, columns, where, args, null)
if (cursor?.moveToFirst() == true) {
val pathIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA)
do {
val curPath = cursor.getString(pathIndex) ?: continue
val curPath = cursor.getStringValue(MediaStore.Images.Media.DATA) ?: continue
if (!mToBeDeleted.contains(curPath)) {
val file = File(curPath)
val size = cursor.getLongValue(MediaStore.Images.Media.SIZE)