Ensure task to remove desktop dialogs is run, fixes #1185

This commit is contained in:
Jeremy Soller 2025-09-16 14:13:04 -06:00
parent 436b8b3a06
commit 942a7f47d3
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA

View file

@ -2716,15 +2716,15 @@ impl Application for App {
let extension = archive_type.extension(); let extension = archive_type.extension();
let name = format!("{}{}", name, extension); let name = format!("{}{}", name, extension);
let to = to.join(name); let to = to.join(name);
return self.operation(Operation::Compress { tasks.push(self.operation(Operation::Compress {
paths, paths,
to, to,
archive_type, archive_type,
password, password,
}); }));
} }
DialogPage::EmptyTrash => { DialogPage::EmptyTrash => {
return self.operation(Operation::EmptyTrash); tasks.push(self.operation(Operation::EmptyTrash));
} }
DialogPage::FailedOperation(id) => { DialogPage::FailedOperation(id) => {
log::warn!("TODO: retry operation {}", id); log::warn!("TODO: retry operation {}", id);
@ -2739,7 +2739,7 @@ impl Application for App {
}, },
_ => unreachable!(), _ => unreachable!(),
}; };
return self.operation(new_op); tasks.push(self.operation(new_op));
} }
DialogPage::MountError { DialogPage::MountError {
mounter_key, mounter_key,
@ -2747,7 +2747,7 @@ impl Application for App {
error: _, error: _,
} => { } => {
if let Some(mounter) = MOUNTERS.get(&mounter_key) { if let Some(mounter) = MOUNTERS.get(&mounter_key) {
return mounter.mount(item).map(|_| cosmic::action::none()); tasks.push(mounter.mount(item).map(|_| cosmic::action::none()));
} }
} }
DialogPage::NetworkAuth { DialogPage::NetworkAuth {
@ -2775,11 +2775,11 @@ impl Application for App {
} }
DialogPage::NewItem { parent, name, dir } => { DialogPage::NewItem { parent, name, dir } => {
let path = parent.join(name); let path = parent.join(name);
return self.operation(if dir { tasks.push(self.operation(if dir {
Operation::NewFolder { path } Operation::NewFolder { path }
} else { } else {
Operation::NewFile { path } Operation::NewFile { path }
}); }));
} }
DialogPage::OpenWith { DialogPage::OpenWith {
path, path,
@ -2821,19 +2821,19 @@ impl Application for App {
} }
} }
DialogPage::PermanentlyDelete { paths } => { DialogPage::PermanentlyDelete { paths } => {
return self.operation(Operation::PermanentlyDelete { paths }); tasks.push(self.operation(Operation::PermanentlyDelete { paths }));
} }
DialogPage::RenameItem { DialogPage::RenameItem {
from, parent, name, .. from, parent, name, ..
} => { } => {
let to = parent.join(name); let to = parent.join(name);
return self.operation(Operation::Rename { from, to }); tasks.push(self.operation(Operation::Rename { from, to }));
} }
DialogPage::Replace { .. } => { DialogPage::Replace { .. } => {
log::warn!("replace dialog should be completed with replace result"); log::warn!("replace dialog should be completed with replace result");
} }
DialogPage::SetExecutableAndLaunch { path } => { DialogPage::SetExecutableAndLaunch { path } => {
return self.operation(Operation::SetExecutableAndLaunch { path }); tasks.push(self.operation(Operation::SetExecutableAndLaunch { path }));
} }
DialogPage::FavoritePathError { entity, .. } => { DialogPage::FavoritePathError { entity, .. } => {
if let Some(FavoriteIndex(favorite_i)) = if let Some(FavoriteIndex(favorite_i)) =
@ -2842,7 +2842,7 @@ impl Application for App {
let mut favorites = self.config.favorites.clone(); let mut favorites = self.config.favorites.clone();
favorites.remove(*favorite_i); favorites.remove(*favorite_i);
config_set!(favorites, favorites); config_set!(favorites, favorites);
return self.update_config(); tasks.push(self.update_config());
} }
} }
} }