mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-16 23:40:32 +08:00
refactor(utils): extract freedesktop mimeapps handling into utils/mime
This commit is contained in:
parent
4ffb8b415f
commit
bd62a4ecc0
@ -493,7 +493,7 @@ pub fn init_scheme() -> Result<()> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
crate::utils::linux::ensure_mimeapps_entries(DESKTOP_FILE, DEEP_LINK_SCHEMES)?;
|
crate::utils::mime::ensure_mimeapps_entries(DESKTOP_FILE, DEEP_LINK_SCHEMES)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
|||||||
@ -1,3 +1,11 @@
|
|||||||
|
//! Utilities for working with freedesktop MIME / mimeapps.list.
|
||||||
|
//!
|
||||||
|
//! NOTE:
|
||||||
|
//! `mimeapps.list` is not a strict INI file.
|
||||||
|
//! We intentionally perform line-based, round-trip edits instead of using
|
||||||
|
//! an INI parser to preserve comments, ordering, duplicate keys and desktop
|
||||||
|
//! environment quirks.
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
use std::env;
|
||||||
@ -5,7 +5,7 @@ pub mod help;
|
|||||||
pub mod i18n;
|
pub mod i18n;
|
||||||
pub mod init;
|
pub mod init;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
pub mod linux;
|
pub mod mime;
|
||||||
pub mod network;
|
pub mod network;
|
||||||
pub mod notification;
|
pub mod notification;
|
||||||
pub mod resolve;
|
pub mod resolve;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user