Changing how desktop_entries dedupes works to only add to dedupe list for valid entries

This commit is contained in:
ellieplayswow 2025-03-08 11:13:45 +00:00 committed by Jacob Kauffmann
parent 926abeb373
commit 87bb6c6064

View file

@ -78,9 +78,6 @@ impl<W: AsyncWrite + Unpin> App<W> {
if deduplicator.contains(appid) {
return None;
}
// Always cache already visited entries to allow overriding entries e.g. by
// placing a modified copy in ~/.local/share/applications/
deduplicator.insert(appid.to_owned());
de.name(&self.locales)?;
@ -136,6 +133,13 @@ impl<W: AsyncWrite + Unpin> App<W> {
return None;
}
// Always cache already visited entries to allow overriding entries e.g. by
// placing a modified copy in ~/.local/share/applications/
//
// We only do this when we can add an entry to our list, otherwise we risk
// ignoring user overrides or valid applications due to shell URL handlers
deduplicator.insert(appid.to_owned());
Some(de)
})
})