From 411081ba98c99f6d908a6457e670764288a17bff Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 18 Mar 2017 18:52:23 +0100 Subject: [PATCH] trim the slash from the end of selected paths --- .../simplemobiletools/commons/dialogs/FilePickerDialog.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/FilePickerDialog.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/FilePickerDialog.kt index 68b33e1f9..a6f1d8019 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/FilePickerDialog.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/FilePickerDialog.kt @@ -21,7 +21,6 @@ import com.simplemobiletools.commons.views.RecyclerViewDivider import kotlinx.android.synthetic.main.dialog_filepicker.view.* import java.io.File import java.util.* -import kotlin.comparisons.compareBy /** * The only filepicker constructor with a couple optional parameters @@ -106,7 +105,7 @@ class FilePickerDialog(val activity: BaseSimpleActivity, private fun createNewFolder() { CreateNewFolderDialog(activity, currPath) { - callback.invoke(it) + callback.invoke(it.trimEnd('/')) mDialog.dismiss() } } @@ -154,7 +153,7 @@ class FilePickerDialog(val activity: BaseSimpleActivity, } private fun sendSuccess() { - callback.invoke(currPath) + callback.invoke(currPath.trimEnd('/')) mDialog.dismiss() }