From 58a838f770d4f1da169986ec737ba7131c1d2d70 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 9 Nov 2020 12:39:10 +0100 Subject: [PATCH] allow setting the Recycle bin and Favorites folders as defaults --- .../gallery/pro/activities/MainActivity.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index 9025cb2db..ba2395584 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -1420,18 +1420,18 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun openDefaultFolder() { if (config.defaultFolder.isEmpty()) { - return; + return } - val defaultDir = File(config.defaultFolder!!) + val defaultDir = File(config.defaultFolder) - if (!defaultDir.exists() || !defaultDir.isDirectory) { + if ((!defaultDir.exists() || !defaultDir.isDirectory) && (config.defaultFolder != RECYCLE_BIN && config.defaultFolder != FAVORITES)) { config.defaultFolder = "" - return; + return } Intent(this, MediaActivity::class.java).apply { - putExtra(DIRECTORY, defaultDir.path) + putExtra(DIRECTORY, config.defaultFolder) handleMediaIntent(this) } }