chore: update freedesktop-desktop-entry to 0.7.5

This commit is contained in:
wiiznokes 2024-09-09 14:34:36 +02:00 committed by GitHub
parent cf06e14545
commit adc2c7e871
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 22 deletions

View file

@ -588,24 +588,15 @@ where
I: AsRef<str>,
L: AsRef<str>,
{
let srcs = fde::Iter::new(fde::default_paths())
.filter_map(|p| fs::read_to_string(&p).ok().and_then(|e| Some((p, e))))
.collect::<Vec<_>>();
let entries = srcs
.iter()
.filter_map(|(p, data)| DesktopEntry::from_str(p, data, locales).ok())
let entries = fde::Iter::new(fde::default_paths())
.entries(Some(locales))
.collect::<Vec<_>>();
ids.iter()
.map(|id| {
fde::matching::get_best_match(
&[id],
&entries,
fde::matching::MatchAppIdOptions::default(),
)
.unwrap_or(&fde::DesktopEntry::from_appid(id.as_ref()))
.to_owned()
fde::matching::find_entry_from_appid(entries.iter(), id.as_ref())
.unwrap_or(&fde::DesktopEntry::from_appid(id.as_ref()))
.to_owned()
})
.collect_vec()
}
@ -1006,7 +997,7 @@ impl cosmic::Application for CosmicAppList {
}
Message::DndData(file_path) => {
if let Some(DndOffer { dock_item, .. }) = self.dnd_offer.as_mut() {
if let Ok(de) = fde::DesktopEntry::from_path(file_path, &self.locales) {
if let Ok(de) = fde::DesktopEntry::from_path(file_path, Some(&self.locales)) {
self.item_ctr += 1;
*dock_item = Some(DockItem {
id: self.item_ctr,