fix #26, crashes at scanning modified files

This commit is contained in:
tibbi 2016-11-15 20:09:14 +01:00
parent 061361bcfa
commit 24b56c9360
2 changed files with 4 additions and 5 deletions

View File

@ -476,7 +476,6 @@ public class ItemsFragment extends android.support.v4.app.Fragment
} else { } else {
item.delete(); item.delete();
} }
Utils.Companion.scanFile(getContext(), item);
} }
private View.OnClickListener undoDeletion = new View.OnClickListener() { private View.OnClickListener undoDeletion = new View.OnClickListener() {

View File

@ -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) val document = context.getFileDocument(currFile.absolutePath, Config.newInstance(context).treeUri)
if (document.canWrite()) if (document.canWrite())
document.renameTo(newName) document.renameTo(newName)
sendSuccess(currFile, newFile) sendSuccess(newFile)
dismiss() dismiss()
} else { } else {
if (currFile.renameTo(newFile)) { if (currFile.renameTo(newFile)) {
sendSuccess(currFile, newFile) sendSuccess(newFile)
dismiss() dismiss()
} else { } else {
context.toast(R.string.error_occurred) 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) { private fun sendSuccess(newFile: File) {
context.scanFiles(arrayListOf(currFile, newFile)) {} context.scanFiles(arrayListOf(newFile)) {}
listener.onSuccess() listener.onSuccess()
} }