mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
always try the simple way of deleting files too, like from internal storage
This commit is contained in:
parent
5f64a02763
commit
0ab0edd78a
3 changed files with 22 additions and 0 deletions
|
@ -208,6 +208,13 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
} else {
|
||||
file.delete()
|
||||
}
|
||||
|
||||
if (file.exists()) {
|
||||
try {
|
||||
file.delete()
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val undoDeletion = View.OnClickListener {
|
||||
|
|
|
@ -228,6 +228,13 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
if (file.delete())
|
||||
wereFilesDeleted = true
|
||||
}
|
||||
|
||||
if (file.exists()) {
|
||||
try {
|
||||
file.delete()
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -295,6 +295,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
mWasFileDeleted = file.delete()
|
||||
}
|
||||
|
||||
if (!mWasFileDeleted) {
|
||||
try {
|
||||
mWasFileDeleted = file.delete()
|
||||
} catch (ignored: Exception) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (mWasFileDeleted) {
|
||||
mBeingDeleted = mToBeDeleted
|
||||
scanPath(mToBeDeleted) { scanCompleted() }
|
||||
|
|
Loading…
Reference in a new issue