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

@ -5,7 +5,7 @@ edition = "2021"
license = "GPL-3.0"
[dependencies]
freedesktop-desktop-entry = "0.6.2"
freedesktop-desktop-entry.workspace = true
libcosmic.workspace = true
tracing-log.workspace = true
tracing-subscriber.workspace = true

View file

@ -154,10 +154,11 @@ pub fn main() -> iced::Result {
let filename = format!("{id}.desktop");
let mut desktop = None;
let locales = get_languages_from_env();
for mut path in freedesktop_desktop_entry::default_paths() {
path.push(&filename);
if let Ok(bytes) = fs::read_to_string(&path) {
if let Ok(entry) = DesktopEntry::from_str(&path, &bytes, &locales) {
if let Ok(entry) = DesktopEntry::from_str(&path, &bytes, Some(&locales)) {
desktop = Some(Desktop {
name: entry
.name(&locales)