Refactor directory size to allow for cancellation

This commit is contained in:
Jeremy Soller 2024-11-15 17:30:25 -07:00
parent 6c0c89e1f7
commit 2f08c05afe
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
3 changed files with 124 additions and 63 deletions

View file

@ -10,7 +10,7 @@ use super::{Mounter, MounterAuth, MounterItem, MounterItems, MounterMessage};
use crate::{
config::IconSizes,
err_str,
tab::{self, ItemMetadata, ItemThumbnail, Location},
tab::{self, DirSize, ItemMetadata, ItemThumbnail, Location},
};
fn gio_icon_to_path(icon: &gio::Icon, size: u16) -> Option<PathBuf> {
@ -135,7 +135,8 @@ fn network_scan(uri: &str, sizes: IconSizes) -> Result<Vec<tab::Item>, String> {
selected: false,
highlighted: false,
overlaps_drag_rect: false,
size: None,
//TODO: scan directory size on gvfs mounts?
dir_size: DirSize::NotDirectory,
});
}
Ok(items)