Update desktop configs cached in locations, fixes #608
This commit is contained in:
parent
f6ce791c4c
commit
d0f0da2eef
2 changed files with 10 additions and 3 deletions
10
src/app.rs
10
src/app.rs
|
|
@ -859,13 +859,19 @@ impl App {
|
||||||
let mut needs_reload = Vec::new();
|
let mut needs_reload = Vec::new();
|
||||||
for entity in self.tab_model.iter() {
|
for entity in self.tab_model.iter() {
|
||||||
if let Some(tab) = self.tab_model.data::<Tab>(entity) {
|
if let Some(tab) = self.tab_model.data::<Tab>(entity) {
|
||||||
if let Location::Desktop(..) = &tab.location {
|
if let Location::Desktop(path, output, _) = &tab.location {
|
||||||
needs_reload.push((entity, tab.location.clone()));
|
needs_reload.push((
|
||||||
|
entity,
|
||||||
|
Location::Desktop(path.clone(), output.clone(), self.config.desktop),
|
||||||
|
));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let mut commands = Vec::with_capacity(needs_reload.len());
|
let mut commands = Vec::with_capacity(needs_reload.len());
|
||||||
for (entity, location) in needs_reload {
|
for (entity, location) in needs_reload {
|
||||||
|
if let Some(tab) = self.tab_model.data_mut::<Tab>(entity) {
|
||||||
|
tab.location = location.clone();
|
||||||
|
}
|
||||||
commands.push(self.rescan_tab(entity, location, None));
|
commands.push(self.rescan_tab(entity, location, None));
|
||||||
}
|
}
|
||||||
Task::batch(commands)
|
Task::batch(commands)
|
||||||
|
|
|
||||||
|
|
@ -68,11 +68,12 @@ pub fn desktop() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
settings = settings.no_main_window(true);
|
settings = settings.no_main_window(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let locations = vec![tab::Location::Desktop(desktop_dir(), String::new(), config.desktop)];
|
||||||
let flags = Flags {
|
let flags = Flags {
|
||||||
config_handler,
|
config_handler,
|
||||||
config,
|
config,
|
||||||
mode: app::Mode::Desktop,
|
mode: app::Mode::Desktop,
|
||||||
locations: vec![tab::Location::Path(desktop_dir())],
|
locations,
|
||||||
};
|
};
|
||||||
cosmic::app::run::<App>(settings, flags)?;
|
cosmic::app::run::<App>(settings, flags)?;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue