mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
fix #168, show an error if file/folder creation fails for whatever reason
This commit is contained in:
@@ -50,7 +50,7 @@ class CreateNewItemDialog(val activity: BaseSimpleActivity, val path: String, va
|
|||||||
|
|
||||||
private fun createDirectory(path: String, alertDialog: AlertDialog, callback: (Boolean) -> Unit) {
|
private fun createDirectory(path: String, alertDialog: AlertDialog, callback: (Boolean) -> Unit) {
|
||||||
when {
|
when {
|
||||||
activity.needsStupidWritePermissions(this.path) -> activity.handleSAFDialog(path) {
|
activity.needsStupidWritePermissions(path) -> activity.handleSAFDialog(path) {
|
||||||
val documentFile = activity.getDocumentFile(path.getParentPath())
|
val documentFile = activity.getDocumentFile(path.getParentPath())
|
||||||
if (documentFile == null) {
|
if (documentFile == null) {
|
||||||
val error = String.format(activity.getString(R.string.could_not_create_folder), path)
|
val error = String.format(activity.getString(R.string.could_not_create_folder), path)
|
||||||
|
@@ -253,6 +253,8 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
|
|||||||
CreateNewItemDialog(activity as SimpleActivity, currentPath) {
|
CreateNewItemDialog(activity as SimpleActivity, currentPath) {
|
||||||
if (it) {
|
if (it) {
|
||||||
refreshItems()
|
refreshItems()
|
||||||
|
} else {
|
||||||
|
activity?.toast(R.string.unknown_error_occurred)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user