mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 08:18:00 +01:00
try removing temp folder only if the path isnt empty
This commit is contained in:
parent
4e530d0517
commit
6c7e406dad
1 changed files with 7 additions and 5 deletions
|
@ -209,6 +209,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun removeTempFolder() {
|
private fun removeTempFolder() {
|
||||||
|
if (config.tempFolderPath.isNotEmpty()) {
|
||||||
val newFolder = File(config.tempFolderPath)
|
val newFolder = File(config.tempFolderPath)
|
||||||
if (newFolder.exists() && newFolder.isDirectory) {
|
if (newFolder.exists() && newFolder.isDirectory) {
|
||||||
if (newFolder.list()?.isEmpty() == true) {
|
if (newFolder.list()?.isEmpty() == true) {
|
||||||
|
@ -217,6 +218,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
}
|
}
|
||||||
config.tempFolderPath = ""
|
config.tempFolderPath = ""
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun tryloadGallery() {
|
private fun tryloadGallery() {
|
||||||
handlePermission(PERMISSION_WRITE_STORAGE) {
|
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||||
|
|
Loading…
Reference in a new issue