mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
refactor(utils): extract freedesktop mimeapps handling into utils/mime
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
#[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 std::collections::HashMap;
|
||||
use std::env;
|
||||
@@ -5,7 +5,7 @@ pub mod help;
|
||||
pub mod i18n;
|
||||
pub mod init;
|
||||
#[cfg(target_os = "linux")]
|
||||
pub mod linux;
|
||||
pub mod mime;
|
||||
pub mod network;
|
||||
pub mod notification;
|
||||
pub mod resolve;
|
||||
|
||||
Reference in New Issue
Block a user