From 514fde9cadbf95c8dd24d057b66fcbceb8e7caae Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 6 May 2026 05:59:00 +0200 Subject: [PATCH] Refactor settings import to use legacy/Heimgeist settings instead of Electron settings --- src-tauri/src/main.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f1c0c42..09419fa 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -264,7 +264,7 @@ fn push_unique_candidate(candidates: &mut Vec, candidate: PathBuf, taur candidates.push(candidate); } -fn electron_settings_candidates(app: &AppHandle, tauri_path: &Path) -> Vec { +fn legacy_settings_candidates(app: &AppHandle, tauri_path: &Path) -> Vec { let mut candidates = Vec::new(); if let Ok(config_dir) = app.path().config_dir() { @@ -282,15 +282,12 @@ fn electron_settings_candidates(app: &AppHandle, tauri_path: &Path) -> Vec Option { - for candidate in electron_settings_candidates(app, tauri_path) { +fn import_legacy_settings_if_available(app: &AppHandle, tauri_path: &Path) -> Option { + for candidate in legacy_settings_candidates(app, tauri_path) { match read_settings_file(&candidate) { Ok(Some(settings)) => { println!( - "Imported Electron settings for first Tauri run from {}", + "Imported legacy Heimgeist settings for first Tauri run from {}", candidate.display() ); return Some(settings); @@ -298,7 +295,7 @@ fn import_electron_settings_if_available( Ok(None) => {} Err(error) => { eprintln!( - "Skipping Electron settings import from {}: {error}", + "Skipping legacy settings import from {}: {error}", candidate.display() ); } @@ -350,7 +347,7 @@ fn load_settings_store(app: &AppHandle) -> Result { } None => { let imported_settings = if explicit_settings_file_path().is_none() { - import_electron_settings_if_available(app, &path) + import_legacy_settings_if_available(app, &path) } else { None };