use a better confirmation dialog text at clearing the recycle bin

This commit is contained in:
tibbi 2021-04-18 20:04:21 +02:00
parent 851fddc67a
commit 4a20695d77

View file

@ -503,18 +503,22 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
config.skipDeleteConfirmation -> deleteFolders()
else -> {
val itemsCnt = selectedKeys.size
val items = if (itemsCnt == 1) {
var folder = getSelectedPaths().first().getFilenameFromPath()
if (folder == RECYCLE_BIN) {
folder = activity.getString(R.string.recycle_bin)
if (itemsCnt == 1 && getSelectedItems().first().isRecycleBin()) {
ConfirmationDialog(activity, "", R.string.empty_recycle_bin_confirmation, R.string.yes, R.string.no) {
deleteFolders()
}
return
}
val items = if (itemsCnt == 1) {
val folder = getSelectedPaths().first().getFilenameFromPath()
"\"$folder\""
} else {
resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)
}
val fileDirItem = getFirstSelectedItem() ?: return
val baseString = if (!config.useRecycleBin || (isOneItemSelected() && fileDirItem.isRecycleBin()) || (isOneItemSelected() && fileDirItem.areFavorites())) {
val baseString = if (!config.useRecycleBin || (isOneItemSelected() && fileDirItem.areFavorites())) {
R.string.deletion_confirmation
} else {
R.string.move_to_recycle_bin_confirmation