Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #11662 from t895/kotlin-settings
Android: Convert Settings to Kotlin
- Loading branch information
Showing
110 changed files
with
6,893 additions
and
6,613 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.settings.model | ||
|
|
||
| interface AbstractBooleanSetting : AbstractSetting { | ||
| val boolean: Boolean | ||
|
|
||
| fun setBoolean(settings: Settings, newValue: Boolean) | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.settings.model | ||
|
|
||
| interface AbstractFloatSetting : AbstractSetting { | ||
| val float: Float | ||
|
|
||
| fun setFloat(settings: Settings, newValue: Float) | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.settings.model | ||
|
|
||
| interface AbstractIntSetting : AbstractSetting { | ||
| val int: Int | ||
|
|
||
| fun setInt(settings: Settings, newValue: Int) | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.settings.model | ||
|
|
||
| interface AbstractStringSetting : AbstractSetting { | ||
| val string: String | ||
|
|
||
| fun setString(settings: Settings, newValue: String) | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.settings.model | ||
|
|
||
| class AdHocBooleanSetting( | ||
| private val file: String, | ||
| private val section: String, | ||
| private val key: String, | ||
| private val defaultValue: Boolean | ||
| ) : AbstractBooleanSetting { | ||
| init { | ||
| require( | ||
| NativeConfig.isSettingSaveable( | ||
| file, | ||
| section, | ||
| key | ||
| ) | ||
| ) { "File/section/key is unknown or legacy" } | ||
| } | ||
|
|
||
| override val isOverridden: Boolean | ||
| get() = NativeConfig.isOverridden(file, section, key) | ||
|
|
||
| override val isRuntimeEditable: Boolean = true | ||
|
|
||
| override fun delete(settings: Settings): Boolean { | ||
| return NativeConfig.deleteKey(settings.writeLayer, file, section, key) | ||
| } | ||
|
|
||
| override val boolean: Boolean | ||
| get() = NativeConfig.getBoolean(NativeConfig.LAYER_ACTIVE, file, section, key, defaultValue) | ||
|
|
||
| override fun setBoolean(settings: Settings, newValue: Boolean) { | ||
| NativeConfig.setBoolean(settings.writeLayer, file, section, key, newValue) | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.settings.model | ||
|
|
||
| class AdHocStringSetting( | ||
| private val file: String, | ||
| private val section: String, | ||
| private val key: String, | ||
| private val defaultValue: String | ||
| ) : AbstractStringSetting { | ||
| init { | ||
| require( | ||
| NativeConfig.isSettingSaveable( | ||
| file, | ||
| section, | ||
| key | ||
| ) | ||
| ) { "File/section/key is unknown or legacy" } | ||
| } | ||
|
|
||
| override val isOverridden: Boolean | ||
| get() = NativeConfig.isOverridden(file, section, key) | ||
|
|
||
| override val isRuntimeEditable: Boolean = true | ||
|
|
||
| override fun delete(settings: Settings): Boolean { | ||
| return NativeConfig.deleteKey(settings.writeLayer, file, section, key) | ||
| } | ||
|
|
||
| override val string: String | ||
| get() = NativeConfig.getString(NativeConfig.LAYER_ACTIVE, file, section, key, defaultValue) | ||
|
|
||
| override fun setString(settings: Settings, newValue: String) { | ||
| NativeConfig.setString(settings.writeLayer, file, section, key, newValue) | ||
| } | ||
| } |
Oops, something went wrong.