mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2026-01-30 07:24:08 +01:00
Dont put preferences in the root of all apps preferences
This commit is contained in:
@@ -11,12 +11,14 @@ import com.russhwolf.settings.JvmPreferencesSettings
|
||||
import java.util.prefs.Preferences
|
||||
|
||||
class PreferenceStoreFactory {
|
||||
private val rootNode: Preferences = Preferences.userRoot()
|
||||
.node("ca/gosyer/tachideskjui")
|
||||
|
||||
fun create(vararg names: String): PreferenceStore {
|
||||
var preferences: Preferences = Preferences.userRoot()
|
||||
names.forEach {
|
||||
preferences = preferences.node(it)
|
||||
}
|
||||
return JvmPreferenceStore(JvmPreferencesSettings(preferences))
|
||||
return JvmPreferenceStore(
|
||||
JvmPreferencesSettings(
|
||||
rootNode.node(names.joinToString(separator = "/"))
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user