Add calendar plugin preferences
This commit is contained in:
@@ -56,6 +56,7 @@ data class LauncherSettingsData internal constructor(
|
||||
@Deprecated("Use calendarSearchProviders `local` instead")
|
||||
val calendarSearchEnabled: Boolean = true,
|
||||
val calendarSearchProviders: Set<String> = setOf("local"),
|
||||
val calendarSearchExcludedCalendars: Set<String> = setOf(),
|
||||
|
||||
val shortcutSearchEnabled: Boolean = true,
|
||||
|
||||
|
||||
+12
@@ -21,4 +21,16 @@ class CalendarSearchSettings internal constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val excludedCalendars
|
||||
get() = dataStore.data.map { it.calendarSearchExcludedCalendars }
|
||||
fun setCalendarExcluded(calendarId: String, excluded: Boolean) {
|
||||
dataStore.update {
|
||||
if (excluded) {
|
||||
it.copy(calendarSearchExcludedCalendars = it.calendarSearchExcludedCalendars + calendarId)
|
||||
} else {
|
||||
it.copy(calendarSearchExcludedCalendars = it.calendarSearchExcludedCalendars - calendarId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user