Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 0 additions & 168 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ i18n-embed = { version = "0.15.3", features = [
i18n-embed-fl = "0.9.3"
rust-embed = "8.5.0"
glob = "0.3.2"
langtag = "0.4"
freedesktop-desktop-entry = "0.7.8"
shlex = "1.3.0"
serde = { version = "1.0.217", features = ["derive"] }
Expand Down
20 changes: 4 additions & 16 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ use cosmic::{
use cosmic_app_list_config::AppListConfig;
use freedesktop_desktop_entry::PathSource;
use itertools::Itertools;
use langtag::{LangTag, LangTagBuf};
use log::error;
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -214,7 +213,7 @@ struct CosmicAppLibrary {
config: AppLibraryConfig,
cur_group: usize,
active_surface: bool,
locale: Option<LangTagBuf>,
locale: Option<String>,
edit_name: Option<String>,
new_group: Option<String>,
dnd_icon: Option<usize>,
Expand Down Expand Up @@ -349,18 +348,8 @@ pub fn menu_control_padding() -> Padding {
impl CosmicAppLibrary {
pub fn load_apps(&mut self) {
let xdg_current_desktop = std::env::var("XDG_CURRENT_DESKTOP").ok();
let locale = self.locale.as_ref().and_then(|l| {
let Some(primary) = l.language().map(|l| l.primary()) else {
return None;
};
Some(if let Some(region) = l.region() {
format!("{}_{}", primary.as_str(), region.as_str())
} else {
primary.as_str().into()
})
});
self.all_entries =
cosmic::desktop::load_applications_filtered(locale.as_deref(), |entry| {
cosmic::desktop::load_applications_filtered(self.locale.as_deref(), |entry| {
entry.exec().is_some()
&& !entry.no_display()
&& xdg_current_desktop
Expand Down Expand Up @@ -1451,10 +1440,9 @@ impl cosmic::Application for CosmicAppLibrary {
config.groups.sort();

let self_ = Self {
// TODO proper conversion is
locale: current_locale::current_locale()
locale: std::env::var("LANG")
.ok()
.and_then(|l| LangTagBuf::new(l).ok()),
.and_then(|l| l.split(".").next().map(str::to_string)),
config,
core,
helper,
Expand Down
Loading