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() .iter()
.position(|s| s == de.appid || s.eq(&de.name(None).unwrap_or_default())) .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_size(128)
.with_cache() .with_cache()
.find() .find();
.map(|buf| DesktopInfo {
id: app_ids.remove(i), Some(DesktopInfo {
icon: buf, id: app_ids.remove(i),
exec: de.exec().unwrap_or_default().to_string(), icon: icon.unwrap_or_default(),
name: de.name(None).unwrap_or_default().to_string(), exec: de.exec().unwrap_or_default().to_string(),
path: path.clone(), name: de.name(None).unwrap_or_default().to_string(),
}) path: path.clone(),
})
} else { } else {
None None
} }