mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-25 12:30:41 +02:00
Allow creating backups without library entries
- In case you want a backup of just settings? - Also disable backup options if dependent option is disabled (and fix being able to toggle disabled items) - Also fix crash in RestoreBackupScreen due to attempt to parcelize Uri - Make restore validation message a bit nicer
This commit is contained in:
@@ -18,3 +18,9 @@ inline fun <reified T : Any> BooleanArray.asDataClass(): T {
|
||||
require(properties.size == this.size) { "Boolean array size does not match data class property count" }
|
||||
return T::class.primaryConstructor!!.call(*this.toTypedArray())
|
||||
}
|
||||
|
||||
fun <T : Any> T.anyEnabled(): Boolean {
|
||||
return this::class.declaredMemberProperties
|
||||
.filterIsInstance<KProperty1<T, Boolean>>()
|
||||
.any { it.get(this) }
|
||||
}
|
||||
Reference in New Issue
Block a user