Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -471,24 +471,24 @@ class MainActivity : SimpleActivity() {
}

private fun goHome() {
if (config.homeFolder != getCurrentFragment()!!.currentPath) {
if (config.homeFolder != getCurrentFragment()?.currentPath) {
openPath(config.homeFolder)
}
}

private fun showSortingDialog() {
ChangeSortingDialog(this, getCurrentFragment()!!.currentPath) {
ChangeSortingDialog(this, getCurrentFragment()?.currentPath) {
(getCurrentFragment() as? ItemsFragment)?.refreshFragment()
}
}

private fun addFavorite() {
config.addFavorite(getCurrentFragment()!!.currentPath)
config.addFavorite(getCurrentFragment()?.currentPath)
refreshMenuItems()
}

private fun removeFavorite() {
config.removeFavorite(getCurrentFragment()!!.currentPath)
config.removeFavorite(getCurrentFragment()?.currentPath)
refreshMenuItems()
}

Expand Down Expand Up @@ -531,7 +531,7 @@ class MainActivity : SimpleActivity() {
favorites.forEachIndexed { index, path ->
val visiblePath = humanizePath(path).replace("/", " / ")
items.add(RadioItem(index, visiblePath, path))
if (path == getCurrentFragment()!!.currentPath) {
if (path == getCurrentFragment()?.currentPath) {
currFavoriteIndex = index
}
}
Expand All @@ -542,12 +542,12 @@ class MainActivity : SimpleActivity() {
}

private fun setAsHome() {
config.homeFolder = getCurrentFragment()!!.currentPath
config.homeFolder = getCurrentFragment()?.currentPath
toast(R.string.home_folder_updated)
}

private fun changeViewType() {
ChangeViewTypeDialog(this, getCurrentFragment()!!.currentPath, getCurrentFragment() is ItemsFragment) {
ChangeViewTypeDialog(this, getCurrentFragment()?.currentPath, getCurrentFragment() is ItemsFragment) {
getAllFragments().forEach {
it?.refreshFragment()
}
Expand Down
Loading