diff --git a/src/app/browser/window/tab/item/client/driver/file.rs b/src/app/browser/window/tab/item/client/driver/file.rs index 9cc34964..fd607384 100644 --- a/src/app/browser/window/tab/item/client/driver/file.rs +++ b/src/app/browser/window/tab/item/client/driver/file.rs @@ -22,44 +22,42 @@ impl File { prelude::FileExtManual, }; - // try handle as directory - File::for_uri(&uri.to_string()).enumerate_children_async( - "standard::content-type", - FileQueryInfoFlags::NONE, - Priority::DEFAULT, - Some(&cancellable), - { - let cancellable = cancellable.clone(); - let uri = uri.clone(); - let _page = self.page.clone(); - move |result| match result { - Ok(file_enumerator) => { - for entry in file_enumerator { - match entry { - Ok(file_info) => match file_info.file_type() { - FileType::Unknown => todo!(), - FileType::Regular => todo!(), - FileType::Directory => todo!(), - FileType::SymbolicLink => todo!(), - FileType::Special => todo!(), - FileType::Shortcut => todo!(), - FileType::Mountable => todo!(), - _ => todo!(), - }, - Err(_) => todo!(), + // try handle as file + File::for_uri(&uri.to_string()).load_contents_async(Some(&cancellable), { + let cancellable = cancellable.clone(); + let uri = uri.clone(); + let _page = self.page.clone(); + move |result| match result { + Ok(_) => todo!(), + // is not a file, try handle as directory + Err(_) => File::for_uri(&uri.to_string()).enumerate_children_async( + "standard::content-type", + FileQueryInfoFlags::NONE, + Priority::DEFAULT, + Some(&cancellable), + |result| match result { + Ok(file_enumerator) => { + for entry in file_enumerator { + match entry { + Ok(file_info) => match file_info.file_type() { + FileType::Unknown => todo!(), + FileType::Regular => todo!(), + FileType::Directory => todo!(), + FileType::SymbolicLink => todo!(), + FileType::Special => todo!(), + FileType::Shortcut => todo!(), + FileType::Mountable => todo!(), + _ => todo!(), + }, + Err(_) => todo!(), + } } } - } - // is not a directory, try handle as file - Err(_) => File::for_uri(&uri.to_string()).load_contents_async( - Some(&cancellable), - |result| match result { - Ok(_) => todo!(), - Err(_) => todo!(), - }, - ), - } - }, - ) + + Err(_) => todo!(), + }, + ), + } + }); } }