diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs index 0f9a3041b3..37cf03a3cc 100644 --- a/crates/gpui/src/app.rs +++ b/crates/gpui/src/app.rs @@ -274,20 +274,6 @@ impl App { self } - pub fn on_open_files(&mut self, mut callback: F) -> &mut Self - where - F: 'static + FnMut(Vec, &mut MutableAppContext), - { - let cx = self.0.clone(); - self.0 - .borrow_mut() - .foreground_platform - .on_open_files(Box::new(move |paths| { - callback(paths, &mut *cx.borrow_mut()) - })); - self - } - pub fn on_open_urls(&mut self, mut callback: F) -> &mut Self where F: 'static + FnMut(Vec, &mut MutableAppContext), diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rs index b4f77df1eb..1e7ab84d50 100644 --- a/crates/gpui/src/platform.rs +++ b/crates/gpui/src/platform.rs @@ -62,7 +62,6 @@ pub(crate) trait ForegroundPlatform { fn on_resign_active(&self, callback: Box); fn on_quit(&self, callback: Box); fn on_event(&self, callback: Box bool>); - fn on_open_files(&self, callback: Box)>); fn on_open_urls(&self, callback: Box)>); fn run(&self, on_finish_launching: Box ()>); diff --git a/crates/gpui/src/platform/mac/platform.rs b/crates/gpui/src/platform/mac/platform.rs index 5789b2f611..e637ebfa3e 100644 --- a/crates/gpui/src/platform/mac/platform.rs +++ b/crates/gpui/src/platform/mac/platform.rs @@ -85,10 +85,6 @@ unsafe fn build_classes() { sel!(handleGPUIMenuItem:), handle_menu_item as extern "C" fn(&mut Object, Sel, id), ); - decl.add_method( - sel!(application:openFiles:), - open_files as extern "C" fn(&mut Object, Sel, id, id), - ); decl.add_method( sel!(application:openURLs:), open_urls as extern "C" fn(&mut Object, Sel, id, id), @@ -107,7 +103,6 @@ pub struct MacForegroundPlatformState { quit: Option>, event: Option bool>>, menu_command: Option>, - open_files: Option)>>, open_urls: Option)>>, finish_launching: Option ()>>, menu_actions: Vec>, @@ -210,10 +205,6 @@ impl platform::ForegroundPlatform for MacForegroundPlatform { self.0.borrow_mut().event = Some(callback); } - fn on_open_files(&self, callback: Box)>) { - self.0.borrow_mut().open_files = Some(callback); - } - fn on_open_urls(&self, callback: Box)>) { self.0.borrow_mut().open_urls = Some(callback); } @@ -673,28 +664,6 @@ extern "C" fn will_terminate(this: &mut Object, _: Sel, _: id) { } } -extern "C" fn open_files(this: &mut Object, _: Sel, _: id, paths: id) { - let paths = unsafe { - (0..paths.count()) - .into_iter() - .filter_map(|i| { - let path = paths.objectAtIndex(i); - match CStr::from_ptr(path.UTF8String() as *mut c_char).to_str() { - Ok(string) => Some(PathBuf::from(string)), - Err(err) => { - log::error!("error converting path to string: {}", err); - None - } - } - }) - .collect::>() - }; - let platform = unsafe { get_foreground_platform(this) }; - if let Some(callback) = platform.0.borrow_mut().open_files.as_mut() { - callback(paths); - } -} - extern "C" fn open_urls(this: &mut Object, _: Sel, _: id, urls: id) { let urls = unsafe { (0..urls.count()) diff --git a/crates/gpui/src/platform/test.rs b/crates/gpui/src/platform/test.rs index 296d4ea90d..85ef26cce3 100644 --- a/crates/gpui/src/platform/test.rs +++ b/crates/gpui/src/platform/test.rs @@ -66,8 +66,6 @@ impl super::ForegroundPlatform for ForegroundPlatform { fn on_event(&self, _: Box bool>) {} - fn on_open_files(&self, _: Box)>) {} - fn on_open_urls(&self, _: Box)>) {} fn run(&self, _on_finish_launching: Box ()>) {