From d297fced207d1e8dc017b312e2a1bd657c57b43d Mon Sep 17 00:00:00 2001 From: Michael Murphy Date: Tue, 7 Sep 2021 20:33:51 +0200 Subject: [PATCH] fix(desktop-entries): Filter desktop entries by App ID rather than Name This change also avoids any entry whose Exec is `false`. This fixes the GNOME Extensions app, which has two entries with the same Name, but differing App ID's. One of these should be ignored by the launcher, and has its Exec as `false`. --- plugins/src/desktop_entries/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/src/desktop_entries/mod.rs b/plugins/src/desktop_entries/mod.rs index 64a68cb..ad370f8 100644 --- a/plugins/src/desktop_entries/mod.rs +++ b/plugins/src/desktop_entries/mod.rs @@ -25,14 +25,14 @@ struct Item { impl Hash for Item { fn hash(&self, state: &mut H) { - self.name.hash(state); + self.appid.hash(state); self.src.hash(state); } } impl PartialEq for Item { fn eq(&self, other: &Self) -> bool { - self.name == other.name && self.src == other.src + self.appid == other.appid && self.src == other.src } } @@ -120,6 +120,10 @@ impl App { if let Some((name, exec)) = entry.name(locale).zip(entry.exec()) { if let Some(exec) = exec.split_ascii_whitespace().next() { + if exec == "false" { + continue; + } + let item = Item { appid: entry.appid.to_owned(), name: name.to_string(),