From 38a87c0bca9f6c76296ddee7fe02d0e94108db05 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sun, 13 Sep 2026 19:05:51 +0200 Subject: [PATCH] Put settings.json where the Android entry point said, not under / MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SettingsStore::open read XDG_CONFIG_HOME and HOME itself. Neither exists on Android, so it resolved to .config/darkroom relative to a working directory of /, and every settings edit on the tablet failed with "read-only file system" — the page reported the error and nothing said why. The doc comment claimed "the same resolution SessionStore does"; now it is, by calling the same function, which honours the directory android_main declares and takes the platform's config directory everywhere else. settings.json sits beside sessions.json on every platform, as the comment always said it did. --- ui/dr-ui/src/settings_store.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ui/dr-ui/src/settings_store.rs b/ui/dr-ui/src/settings_store.rs index b2231c3..fe98eb3 100644 --- a/ui/dr-ui/src/settings_store.rs +++ b/ui/dr-ui/src/settings_store.rs @@ -25,12 +25,17 @@ pub struct SettingsStore { impl SettingsStore { /// Open the store at the platform config location. /// - /// `settings.json` in the platform's config directory — `dr_plat::dirs` - /// has the rule per platform — which is the same resolution `SessionStore` - /// makes, so the two files sit together and a user backing up one takes - /// both. + /// **The same resolution `SessionStore` makes**, by calling the same + /// function, so `settings.json` sits beside `sessions.json` on every + /// platform. That is `dr_plat::dirs`' config directory on a desktop and + /// the directory the entry point declared on Android — the second half + /// was the bug: this used to read `XDG_CONFIG_HOME` and `HOME` itself, + /// neither exists on Android, and the result was `.config/darkroom` + /// relative to a working directory of `/`. Every settings edit on a + /// tablet failed with "read-only file system", and the page said so + /// without saying why. pub fn open() -> Self { - Self::open_at(dr_plat::base_dir(dr_plat::Base::Config).join("settings.json")) + Self::open_at(dr_sync::account::config_dir().join("settings.json")) } /// Open at an explicit path — for tests, and for a non-default location.