From 3d6329766adb77b0770c80851f4e5a09233a6e2a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 5 Dec 2016 23:21:06 +0100 Subject: [PATCH] remove a redundant variable --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 4 ++-- .../simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index 96b8e14de..4c8e9d42d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -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) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt index 3e865e14f..424c7740a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt @@ -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)