removing the folder locking check from a few places to avoid duplication

This commit is contained in:
tibbi 2020-04-18 15:30:43 +02:00
parent 8cf56dffad
commit 5ca662103b

View File

@ -103,12 +103,8 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
if (realPath.getFilenameFromPath().contains('.') || filename.contains('.')) { if (realPath.getFilenameFromPath().contains('.') || filename.contains('.')) {
if (isFileTypeVisible(realPath)) { if (isFileTypeVisible(realPath)) {
bottom_actions.beGone() bottom_actions.beGone()
handleLockedFolderOpening(realPath.getParentPath()) { success -> sendViewPagerIntent(realPath)
if (success) { finish()
sendViewPagerIntent(realPath)
}
finish()
}
return return
} }
} else { } else {
@ -120,13 +116,9 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
if (mUri!!.scheme == "file") { if (mUri!!.scheme == "file") {
if (filename.contains('.')) { if (filename.contains('.')) {
bottom_actions.beGone() bottom_actions.beGone()
handleLockedFolderOpening(mUri!!.path!!.getParentPath()) { success -> rescanPaths(arrayListOf(mUri!!.path!!))
if (success) { sendViewPagerIntent(mUri!!.path!!)
rescanPaths(arrayListOf(mUri!!.path!!)) finish()
sendViewPagerIntent(mUri!!.path!!)
}
finish()
}
} }
return return
} else { } else {
@ -134,13 +126,9 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
if (path != mUri.toString() && path.isNotEmpty() && mUri!!.authority != "mms" && filename.contains('.') && getDoesFilePathExist(path)) { if (path != mUri.toString() && path.isNotEmpty() && mUri!!.authority != "mms" && filename.contains('.') && getDoesFilePathExist(path)) {
if (isFileTypeVisible(path)) { if (isFileTypeVisible(path)) {
bottom_actions.beGone() bottom_actions.beGone()
handleLockedFolderOpening(path.getParentPath()) { success -> rescanPaths(arrayListOf(mUri!!.path!!))
if (success) { sendViewPagerIntent(path)
rescanPaths(arrayListOf(mUri!!.path!!)) finish()
sendViewPagerIntent(path)
}
finish()
}
return return
} }
} }