From 41eb50662231c33fc61450219a2853d2a67d00ee Mon Sep 17 00:00:00 2001 From: Syer10 Date: Fri, 28 May 2021 18:40:34 -0400 Subject: [PATCH] Dont put preferences in the root of all apps preferences --- .../ca/gosyer/core/prefs/PreferenceStoreProvider.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/ca/gosyer/core/prefs/PreferenceStoreProvider.kt b/src/main/kotlin/ca/gosyer/core/prefs/PreferenceStoreProvider.kt index a90b5088..6269726b 100644 --- a/src/main/kotlin/ca/gosyer/core/prefs/PreferenceStoreProvider.kt +++ b/src/main/kotlin/ca/gosyer/core/prefs/PreferenceStoreProvider.kt @@ -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 = "/")) + ) + ) } }