mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-04-01 20:30:31 +02:00
fix #26, crashes at scanning modified files
This commit is contained in:
parent
061361bcfa
commit
24b56c9360
app/src/main
java/com/simplemobiletools/filemanager/fragments
kotlin/com/simplemobiletools/filemanager/dialogs
@ -476,7 +476,6 @@ public class ItemsFragment extends android.support.v4.app.Fragment
|
||||
} else {
|
||||
item.delete();
|
||||
}
|
||||
Utils.Companion.scanFile(getContext(), item);
|
||||
}
|
||||
|
||||
private View.OnClickListener undoDeletion = new View.OnClickListener() {
|
||||
|
@ -40,11 +40,11 @@ class RenameItemDialog(val context: Context, val path: String, val item: FileDir
|
||||
val document = context.getFileDocument(currFile.absolutePath, Config.newInstance(context).treeUri)
|
||||
if (document.canWrite())
|
||||
document.renameTo(newName)
|
||||
sendSuccess(currFile, newFile)
|
||||
sendSuccess(newFile)
|
||||
dismiss()
|
||||
} else {
|
||||
if (currFile.renameTo(newFile)) {
|
||||
sendSuccess(currFile, newFile)
|
||||
sendSuccess(newFile)
|
||||
dismiss()
|
||||
} else {
|
||||
context.toast(R.string.error_occurred)
|
||||
@ -57,8 +57,8 @@ class RenameItemDialog(val context: Context, val path: String, val item: FileDir
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendSuccess(currFile: File, newFile: File) {
|
||||
context.scanFiles(arrayListOf(currFile, newFile)) {}
|
||||
private fun sendSuccess(newFile: File) {
|
||||
context.scanFiles(arrayListOf(newFile)) {}
|
||||
listener.onSuccess()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user