From 3d4db61f61f518b414cb48696ea4f883bccc5092 Mon Sep 17 00:00:00 2001 From: axiangcoding Date: Thu, 13 Jun 2024 11:34:06 +0800 Subject: [PATCH] update --- src-tauri/src/commands/os.rs | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src-tauri/src/commands/os.rs b/src-tauri/src/commands/os.rs index b8b876c..7eb417a 100644 --- a/src-tauri/src/commands/os.rs +++ b/src-tauri/src/commands/os.rs @@ -17,33 +17,7 @@ pub fn show_in_folder(path: String) { #[cfg(target_os = "linux")] { - if path.contains(",") { - // see https://gitlab.freedesktop.org/dbus/dbus/-/issues/76 - let new_path = match metadata(&path).unwrap().is_dir() { - true => path, - false => { - let mut path2 = PathBuf::from(path); - path2.pop(); - path2.into_os_string().into_string().unwrap() - } - }; - Command::new("xdg-open").arg(&new_path).spawn().unwrap(); - } else { - if let Ok(Fork::Child) = daemon(false, false) { - Command::new("dbus-send") - .args([ - "--session", - "--dest=org.freedesktop.FileManager1", - "--type=method_call", - "/org/freedesktop/FileManager1", - "org.freedesktop.FileManager1.ShowItems", - format!("array:string:\"file://{path}\"").as_str(), - "string:\"\"", - ]) - .spawn() - .unwrap(); - } - } + Command::new("xdg-open").args([path]).spawn().unwrap(); } #[cfg(target_os = "macos")]