diff --git a/crates/filesystem/src/path_cache.rs b/crates/filesystem/src/path_cache.rs index 2a8c2b96..f3fe6f2f 100644 --- a/crates/filesystem/src/path_cache.rs +++ b/crates/filesystem/src/path_cache.rs @@ -48,7 +48,7 @@ struct Cache { #[derive(Debug)] pub struct FileSystem { - pub(crate) fs: F, + fs: F, cache: parking_lot::RwLock, } diff --git a/crates/filesystem/src/project.rs b/crates/filesystem/src/project.rs index a049db2f..135a036d 100644 --- a/crates/filesystem/src/project.rs +++ b/crates/filesystem/src/project.rs @@ -65,21 +65,6 @@ impl FileSystem { pub fn unload_project(&mut self) { *self = FileSystem::Unloaded; } - - // gives access to the non-path cache'd filesystem, for when you need to do direct manipulation of the filesystem - // the path cache should be rebuilt after this! - pub fn raw_filesystem(&self) -> &impl crate::FileSystem { - match self { - FileSystem::Unloaded | FileSystem::HostLoaded(_) => panic!("not loaded"), - FileSystem::Loaded { filesystem, .. } => &filesystem.fs, - } - } - - pub fn rebuild_path_cache(&self) { - if let Self::Loaded { filesystem, .. } = self { - filesystem.rebuild(); - } - } } // Not platform specific diff --git a/crates/ui/src/windows/config_window.rs b/crates/ui/src/windows/config_window.rs index 0512db1f..d0f4547a 100644 --- a/crates/ui/src/windows/config_window.rs +++ b/crates/ui/src/windows/config_window.rs @@ -36,7 +36,7 @@ impl Window { } } -const FORMAT_WARNING: &str = "Luminol will need to convert your project.\nThis is not 100% safe yet, make backups!\nPress OK to continue."; +const FORMAT_WARNING: &str = "While the option is provided,\nLuminol cannot convert between formats yet.\nIt can still read other formats, however."; // "Luminol will need to convert your project.\nThis is not 100% safe yet, make backups!\nPress OK to continue."; impl luminol_core::Window for Window { fn id(&self) -> egui::Id { @@ -111,16 +111,8 @@ impl luminol_core::Window for Window { ) .clicked(); if clicked { - update_state - .data - .convert_project( - update_state.filesystem.raw_filesystem(), - config, - self.selected_data_format, - ) - .unwrap(); // TODO handle - update_state.filesystem.rebuild_path_cache(); // I do not like this solution. A dedicated tool for this would be more appropriate. config.project.data_format = self.selected_data_format; + // TODO add conversion logic } }