mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 13:08:00 +01:00
show an error at deleting a folder exception, to see what is wrong there
This commit is contained in:
parent
8bbc498724
commit
f0736fe634
1 changed files with 7 additions and 1 deletions
|
@ -546,7 +546,13 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
val fileDirItems = folders.asSequence().filter { it.isDirectory }.map { FileDirItem(it.absolutePath, it.name, true) }.toMutableList() as ArrayList<FileDirItem>
|
val fileDirItems = folders.asSequence().filter { it.isDirectory }.map { FileDirItem(it.absolutePath, it.name, true) }.toMutableList() as ArrayList<FileDirItem>
|
||||||
when {
|
when {
|
||||||
fileDirItems.isEmpty() -> return
|
fileDirItems.isEmpty() -> return
|
||||||
fileDirItems.size == 1 -> toast(String.format(getString(R.string.deleting_folder), fileDirItems.first().name))
|
fileDirItems.size == 1 -> {
|
||||||
|
try {
|
||||||
|
toast(String.format(getString(R.string.deleting_folder), fileDirItems.first().name))
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
else -> {
|
else -> {
|
||||||
val baseString = if (config.useRecycleBin) R.plurals.moving_items_into_bin else R.plurals.delete_items
|
val baseString = if (config.useRecycleBin) R.plurals.moving_items_into_bin else R.plurals.delete_items
|
||||||
val deletingItems = resources.getQuantityString(baseString, fileDirItems.size, fileDirItems.size)
|
val deletingItems = resources.getQuantityString(baseString, fileDirItems.size, fileDirItems.size)
|
||||||
|
|
Loading…
Reference in a new issue