mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-19 06:48:00 +01:00
use list() instead of listFiles() in some places
This commit is contained in:
parent
490f7f683a
commit
4733bf95f9
2 changed files with 3 additions and 3 deletions
|
@ -361,7 +361,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
|
|
||||||
private fun deleteDirectoryIfEmpty() {
|
private fun deleteDirectoryIfEmpty() {
|
||||||
val file = File(mPath)
|
val file = File(mPath)
|
||||||
if (config.deleteEmptyFolders && !file.isDownloadsFolder() && file.isDirectory && file.listFiles()?.isEmpty() == true) {
|
if (config.deleteEmptyFolders && !file.isDownloadsFolder() && file.isDirectory && file.list()?.isEmpty() == true) {
|
||||||
deleteFile(file, true)
|
deleteFile(file, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -615,7 +615,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
|
|
||||||
var parent = file.parentFile ?: return false
|
var parent = file.parentFile ?: return false
|
||||||
while (true) {
|
while (true) {
|
||||||
if (parent.isHidden || parent.listFiles()?.contains(File(NOMEDIA)) == true) {
|
if (parent.isHidden || parent.list()?.contains(NOMEDIA) == true) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -800,7 +800,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
|
|
||||||
private fun deleteDirectoryIfEmpty() {
|
private fun deleteDirectoryIfEmpty() {
|
||||||
val file = File(mDirectory)
|
val file = File(mDirectory)
|
||||||
if (config.deleteEmptyFolders && !file.isDownloadsFolder() && file.isDirectory && file.listFiles()?.isEmpty() == true) {
|
if (config.deleteEmptyFolders && !file.isDownloadsFolder() && file.isDirectory && file.list()?.isEmpty() == true) {
|
||||||
deleteFile(file, true)
|
deleteFile(file, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue