forked from dolphin-emu/dolphin
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dolphin-emu#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
12 changes: 0 additions & 12 deletions
12
...c/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.java
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.kt
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) | ||
} |
12 changes: 0 additions & 12 deletions
12
...src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractFloatSetting.java
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...p/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractFloatSetting.kt
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) | ||
} |
12 changes: 0 additions & 12 deletions
12
...p/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractIntSetting.java
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractIntSetting.kt
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) | ||
} |
14 changes: 0 additions & 14 deletions
14
.../app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
...id/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.kt
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 | ||
} |
13 changes: 0 additions & 13 deletions
13
...rc/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractStringSetting.java
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
.../src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractStringSetting.kt
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) | ||
} |
62 changes: 0 additions & 62 deletions
62
.../src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...pp/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.kt
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) | ||
} | ||
} |
61 changes: 0 additions & 61 deletions
61
...p/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocStringSetting.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocStringSetting.kt
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.