mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 09:36:42 +01:00
emit tasks for columns
This commit is contained in:
parent
e16e8131aa
commit
59c2fdcbcd
6 changed files with 79 additions and 55 deletions
23
src/model.rs
23
src/model.rs
|
|
@ -48,26 +48,3 @@ impl Taggart {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn entries_under (
|
||||
entries: &mut [Entry], index: usize
|
||||
) -> Option<Vec<Arc<RwLock<Metadata>>>> {
|
||||
let path = if let Some(Entry { path, info, .. }) = entries.get(index)
|
||||
&& let Metadata::Directory { .. } = &*info.read().unwrap()
|
||||
{
|
||||
Some(path.clone())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
if let Some(path) = path {
|
||||
let mut others = vec![];
|
||||
for other in entries.iter_mut() {
|
||||
if other.path.starts_with(&path) && !other.is_directory() {
|
||||
others.push(other.info.clone());
|
||||
}
|
||||
}
|
||||
Some(others)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue