From 7474a129d417a13e43a26e1e93ac00898ee13f32 Mon Sep 17 00:00:00 2001 From: Kitsu Date: Sat, 19 Dec 2020 19:58:06 +0300 Subject: [PATCH] Support absolute icon paths --- src/desktop.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/desktop.rs b/src/desktop.rs index 8aa3ce7..2fb9446 100644 --- a/src/desktop.rs +++ b/src/desktop.rs @@ -98,9 +98,15 @@ fn traverse_dir_entry(mut entries: &mut Vec, dir_entry: DirEntry) { .map(|s| s == "true") .unwrap_or(false), icon: main_section.attr("Icon").and_then(|name| { - icon_paths() - .and_then(|p| p.get(name)) - .and_then(|icons| icons.iter().filter_map(Icon::load_icon).next()) + let icon_path = Path::new(name); + + if icon_path.is_absolute() { + Icon::load_icon(icon_path) + } else { + icon_paths() + .and_then(|p| p.get(name)) + .and_then(|icons| icons.iter().filter_map(Icon::load_icon).next()) + } }), }); }