fix: Panic on long numerical file names
Closes: #258 [lexical_sort](https://github.com/Aloso/lexical-sort) is currently unmaintained. The author recommends switching to the `icu` crate which is maintained by the Unicode Consortium.
This commit is contained in:
parent
5ec14f86b3
commit
783256fe8b
6 changed files with 622 additions and 28 deletions
|
|
@ -94,6 +94,8 @@ impl MimeAppCache {
|
|||
// Only available when using desktop feature of libcosmic, which only works on Unix-likes
|
||||
#[cfg(feature = "desktop")]
|
||||
pub fn reload(&mut self) {
|
||||
use crate::localize::LANGUAGE_SORTER;
|
||||
|
||||
let start = Instant::now();
|
||||
|
||||
self.cache.clear();
|
||||
|
|
@ -245,7 +247,7 @@ impl MimeAppCache {
|
|||
apps.sort_by(|a, b| match (a.is_default, b.is_default) {
|
||||
(true, false) => Ordering::Less,
|
||||
(false, true) => Ordering::Greater,
|
||||
_ => lexical_sort::natural_lexical_cmp(&a.name, &b.name),
|
||||
_ => LANGUAGE_SORTER.compare(&a.name, &b.name),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue