fix(wallpaper): folders and images containing spaces
This commit is contained in:
parent
3e228956cc
commit
e0ae268f11
1 changed files with 8 additions and 1 deletions
|
|
@ -194,11 +194,16 @@ impl page::Page<crate::pages::Message> for Page {
|
|||
self.active_dialog = ActiveDialog::None;
|
||||
|
||||
if let Some(selection) = selections.first() {
|
||||
let path = PathBuf::from(selection.path());
|
||||
let Ok(path) = selection.to_file_path() else {
|
||||
tracing::error!(path = selection.path(), "not a valid file path");
|
||||
return Command::none();
|
||||
};
|
||||
|
||||
match active_dialog {
|
||||
ActiveDialog::AddFolder => {
|
||||
if path.is_dir() {
|
||||
tracing::info!(?path, "opening new folder");
|
||||
|
||||
let _res = self.config.set_current_folder(Some(path.clone()));
|
||||
|
||||
// Add the selected folder to the recent folders list.
|
||||
|
|
@ -222,6 +227,8 @@ impl page::Page<crate::pages::Message> for Page {
|
|||
|
||||
ActiveDialog::AddImage => {
|
||||
if path.is_file() {
|
||||
tracing::info!(?path, "opening custom image");
|
||||
|
||||
// Loads a single custom image and its thumbnail for display in the backgrounds view.
|
||||
return cosmic::command::future(async move {
|
||||
let result =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue