Show main desktop entry name in the desktop action's description
This commit is contained in:
@@ -70,7 +70,7 @@ pub fn get_matches(input: RString, entries: &mut Vec<(DesktopEntry, u64)>) -> RV
|
||||
.map(|(entry, id, _)| Match {
|
||||
title: entry.name.into(),
|
||||
icon: ROption::RSome(entry.icon.into()),
|
||||
description: ROption::RNone,
|
||||
description: entry.desc.map(|desc| desc.into()).into(),
|
||||
id: ROption::RSome(id),
|
||||
})
|
||||
.collect()
|
||||
|
@@ -6,6 +6,7 @@ use crate::Config;
|
||||
pub struct DesktopEntry {
|
||||
pub exec: String,
|
||||
pub name: String,
|
||||
pub desc: Option<String>,
|
||||
pub icon: String,
|
||||
}
|
||||
|
||||
@@ -68,6 +69,7 @@ impl DesktopEntry {
|
||||
exec
|
||||
},
|
||||
name: map.get("Name")?.to_string(),
|
||||
desc: None,
|
||||
icon: map
|
||||
.get("Icon")
|
||||
.unwrap_or(&"application-x-executable")
|
||||
@@ -108,9 +110,10 @@ impl DesktopEntry {
|
||||
None => continue,
|
||||
},
|
||||
name: match map.get("Name") {
|
||||
Some(name) => format!("{}: {}", entry.name, name),
|
||||
Some(name) => name.to_string(),
|
||||
None => continue,
|
||||
},
|
||||
desc: Some(entry.name.clone()),
|
||||
icon: entry.icon.clone(),
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user