git.lucas.co / cce-files
file manager
git clone https://git.lucas.co/cce-files.git

commit9706c7359ca476ac141f62cfa74bff59587cc785
parentbe98cbdb40
authorLucas Galante <[email protected]>
date2026-07-07 12:17
refactor: use cce_ui::config::cce_config_dir for the config dir

Delegate the local cce_config_dir to the shared toolkit helper instead of
reimplementing the XDG_CONFIG_HOME/$HOME logic.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

 src/services/fs.rs | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/services/fs.rs b/src/services/fs.rs
index c481f24..6d01095 100644
--- a/src/services/fs.rs
+++ b/src/services/fs.rs
@@ -325,11 +325,7 @@ fn infer_file_type(name: &str, is_dir: bool) -> String {
 /// Base config directory for cce: `$XDG_CONFIG_HOME/cce`, else `$HOME/.config/cce`.
 /// Returns `None` only when neither variable is usable.
 pub fn cce_config_dir() -> Option<PathBuf> {
-    let base = match std::env::var("XDG_CONFIG_HOME") {
-        Ok(xdg) if !xdg.is_empty() => PathBuf::from(xdg),
-        _ => PathBuf::from(std::env::var("HOME").ok()?).join(".config"),
-    };
-    Some(base.join("cce"))
+    Some(cce_ui::config::cce_config_dir())
 }
 
 fn get_last_dir_file_path() -> Option<PathBuf> {