From eb909442e813536b8e123eb7b5dcc3d8f8b99c72 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 21 Oct 2021 11:16:03 +0200 Subject: [PATCH] avoid scanning the recycle bin folder twice --- .../simplemobiletools/gallery/pro/activities/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 4a4a3d6a1..c6a202d76 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 @@ -1034,7 +1034,9 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val foldersToScan = mLastMediaFetcher!!.getFoldersToScan() foldersToScan.add(FAVORITES) if (config.showRecycleBinAtFolders) { - foldersToScan.add(RECYCLE_BIN) + if (!foldersToScan.contains(RECYCLE_BIN)) { + foldersToScan.add(RECYCLE_BIN) + } } else { foldersToScan.remove(RECYCLE_BIN) }