From a48300e71380850f72d6434e5b993cb4e5bcc283 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 20 May 2021 11:09:21 +0200 Subject: [PATCH] get Recents file name from its path, if not filled in --- .../filemanager/pro/fragments/RecentsFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt index 2cbc3f9b..a0c0835b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt @@ -122,7 +122,7 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage context?.queryCursor(uri, projection, sortOrder = sortOrder, showErrors = true) { cursor -> val path = cursor.getStringValue(FileColumns.DATA) - val name = cursor.getStringValue(FileColumns.DISPLAY_NAME) + val name = cursor.getStringValue(FileColumns.DISPLAY_NAME) ?: path.getFilenameFromPath() val size = cursor.getLongValue(FileColumns.SIZE) val modified = cursor.getLongValue(FileColumns.DATE_MODIFIED) * 1000 val fileDirItem = ListItem(path, name, false, 0, size, modified, false)