Android: Convert AbstractSetting to Kotlin

This commit is contained in:
Charles Lombardo 2023-03-15 03:22:38 -04:00
parent 43fa5cf5e4
commit 21e0b5b9d9
3 changed files with 14 additions and 20 deletions

View File

@ -1,14 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-or-later
package org.dolphinemu.dolphinemu.features.settings.model;
import androidx.annotation.NonNull;
public interface AbstractSetting
{
boolean isOverridden();
boolean isRuntimeEditable();
boolean delete(@NonNull Settings settings);
}

View File

@ -0,0 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-or-later
package org.dolphinemu.dolphinemu.features.settings.model
interface AbstractSetting {
val isOverridden: Boolean
val isRuntimeEditable: Boolean
fun delete(settings: Settings): Boolean
}

View File

@ -6,13 +6,11 @@ class ScaledIntSetting(
private val scale: Int, private val scale: Int,
private val setting: AbstractIntSetting private val setting: AbstractIntSetting
) : AbstractIntSetting { ) : AbstractIntSetting {
override fun isOverridden(): Boolean { override val isOverridden: Boolean
return setting.isOverridden() get() = setting.isOverridden
}
override fun isRuntimeEditable(): Boolean { override val isRuntimeEditable: Boolean
return setting.isRuntimeEditable get() = setting.isRuntimeEditable
}
override fun delete(settings: Settings): Boolean { override fun delete(settings: Settings): Boolean {
return setting.delete(settings) return setting.delete(settings)