app-list: Don't skip DesktopEntry if icon is missing

This commit is contained in:
Victoria Brekenfeld 2023-09-21 13:20:56 +02:00
parent c16f761bc0
commit 353985170c

View file

@ -264,17 +264,18 @@ fn desktop_info_for_app_ids(mut app_ids: Vec<String>) -> Vec<DesktopInfo> {
.iter()
.position(|s| s == de.appid || s.eq(&de.name(None).unwrap_or_default()))
{
freedesktop_icons::lookup(de.icon().unwrap_or(de.appid))
let icon = freedesktop_icons::lookup(de.icon().unwrap_or(de.appid))
.with_size(128)
.with_cache()
.find()
.map(|buf| DesktopInfo {
id: app_ids.remove(i),
icon: buf,
exec: de.exec().unwrap_or_default().to_string(),
name: de.name(None).unwrap_or_default().to_string(),
path: path.clone(),
})
.find();
Some(DesktopInfo {
id: app_ids.remove(i),
icon: icon.unwrap_or_default(),
exec: de.exec().unwrap_or_default().to_string(),
name: de.name(None).unwrap_or_default().to_string(),
path: path.clone(),
})
} else {
None
}