use list() instead of listFiles() in some places

This commit is contained in:
tibbi 2017-12-27 10:10:14 +01:00
parent 490f7f683a
commit 4733bf95f9
2 changed files with 3 additions and 3 deletions

View file

@ -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)
}
}

View file

@ -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)
}