mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 22:37:59 +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() {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -615,7 +615,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
|
||||
var parent = file.parentFile ?: return false
|
||||
while (true) {
|
||||
if (parent.isHidden || parent.listFiles()?.contains(File(NOMEDIA)) == true) {
|
||||
if (parent.isHidden || parent.list()?.contains(NOMEDIA) == true) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -800,7 +800,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
|
||||
private fun deleteDirectoryIfEmpty() {
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue