Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

Sidebar rereads the drives after a drive is renamed in Properties

gelenmedyaa1743d787f0b
diff --git a/crates/rf-app/src/properties_view.rs b/crates/rf-app/src/properties_view.rs
index bc0c8eea..6107b358 100644
--- a/crates/rf-app/src/properties_view.rs
+++ b/crates/rf-app/src/properties_view.rs
@@ -930,6 +930,7 @@ impl PropsView {
if let Some(d) = &mut v.drive {
d.label = l;
}
+ crate::workspace::refresh_places_everywhere(cx);
}
if close {
window.remove_window();
diff --git a/crates/rf-app/src/workspace.rs b/crates/rf-app/src/workspace.rs
index 166b34df..8b1d0abe 100644
--- a/crates/rf-app/src/workspace.rs
+++ b/crates/rf-app/src/workspace.rs
@@ -596,6 +596,15 @@ pub(crate) fn open_workspaces(cx: &App) -> Vec<(AnyWindowHandle, WeakEntity<Work
cx.try_global::<OpenWorkspaces>().map(|g| g.0.clone()).unwrap_or_default()
}
+/// Every window's sidebar reads its places again (a drive renamed in Properties: issue 729, the old name stayed until a restart).
+pub fn refresh_places_everywhere(cx: &mut App) {
+ for (_, ws) in open_workspaces(cx) {
+ if let Some(ws) = ws.upgrade() {
+ ws.update(cx, |w, cx| w.places.update(cx, |p, cx| p.refresh(cx)));
+ }
+ }
+}
+
pub fn save_all_sessions(cx: &mut App) {
let list = cx.try_global::<OpenWorkspaces>().map(|g| g.0.clone()).unwrap_or_default();
for (handle, ws) in list {