Skip to content

Commit

Permalink
Remove deprecated getShowOnlyPersonalPair
Browse files Browse the repository at this point in the history
  • Loading branch information
sunkup committed Jan 20, 2025
1 parent 91b474c commit 8f13f5a
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,25 @@ class AccountSettings @AssistedInject constructor(

// UI settings

fun getShowOnlyPersonal(): Boolean {
@Suppress("DEPRECATION")
val pair = getShowOnlyPersonalPair()
return pair.first
/**
* Whether to show only personal collections in the UI
*
* @return *true* if only personal collections shall be shown; *false* otherwise
*/
fun getShowOnlyPersonal(): Boolean = when (settingsManager.getIntOrNull(KEY_SHOW_ONLY_PERSONAL)) {
0 -> false
1 -> true
else /* including -1 */ -> accountManager.getUserData(account, KEY_SHOW_ONLY_PERSONAL) != null
}
fun getShowOnlyPersonalLocked(): Boolean {
@Suppress("DEPRECATION")
val pair = getShowOnlyPersonalPair()
return !pair.second

/**
* Whether the user shall be able to change the setting (= setting not locked)
*
* @return *true* if the setting is locked; *false* otherwise
*/
fun getShowOnlyPersonalLocked(): Boolean = when (settingsManager.getIntOrNull(KEY_SHOW_ONLY_PERSONAL)) {
0, 1 -> true
else /* including -1 */ -> false
}

/**
Expand Down

0 comments on commit 8f13f5a

Please sign in to comment.