diff --git a/ui/dr-ui/src/preset_store.rs b/ui/dr-ui/src/preset_store.rs index 710133a..f9179ea 100644 --- a/ui/dr-ui/src/preset_store.rs +++ b/ui/dr-ui/src/preset_store.rs @@ -27,17 +27,14 @@ pub struct PresetStore { impl PresetStore { /// Open the store at the platform config location. /// - /// Linux: `$XDG_CONFIG_HOME/darkroom/presets.drpl`, falling back to - /// `~/.config` — the same resolution `SettingsStore` does, so the files sit - /// together and a user backing up one takes all of them. + /// Beside `settings.json`, in [`dr_sync::account::config_dir`], so a user + /// backing up one takes all of them. Never from `HOME` directly: Android + /// declares its data directory rather than setting `HOME`, and a path + /// built from an empty one is `/.config`, which is read-only — every + /// preset saved on the tablet failed. Windows sets no `HOME` either, and + /// got a directory relative to wherever the app was started. pub fn open() -> Self { - let dir = std::env::var_os("XDG_CONFIG_HOME") - .map(PathBuf::from) - .unwrap_or_else(|| { - PathBuf::from(std::env::var("HOME").unwrap_or_default()).join(".config") - }) - .join("darkroom"); - Self::open_at(dir.join(format!( + Self::open_at(dr_sync::account::config_dir().join(format!( "presets.{}", dr_pipeline::preset::LIBRARY_EXTENSION )))