melib: fix invalid folder hierarchy in Backend::folders()

embed
Manos Pitsidianakis 2019-04-04 13:08:23 +03:00
parent 37f95dd86d
commit ac0e2cbe44
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 13 additions and 4 deletions

View File

@ -238,6 +238,7 @@ eprintln!("Create event {} {} {}", env.hash(), env.subject(), pathbuf.display())
if let Some((k, v)) =
index_lock.iter_mut().find(|(_, v)| **v == pathbuf)
{
//TODO FIXME This doesn't make sense?
*v = pathbuf.clone();
*k
} else {
@ -409,10 +410,18 @@ impl MaildirType {
path.file_name().unwrap().to_str().unwrap().to_string(),
Vec::with_capacity(0),
) {
if f.is_valid().is_ok() {
folders.push(f);
}
}
}
if folders.is_empty() {
recurse_folders(&mut folders, &path);
} else {
folders[0].children = recurse_folders(&mut folders, &path);
}
let hash_indexes = Arc::new(Mutex::new(FnvHashMap::with_capacity_and_hasher(
folders.len(),
Default::default(),