From e1f72f845eadfc39495566b0fda94706f6926e63 Mon Sep 17 00:00:00 2001 From: Petre Tudor Date: Fri, 2 Mar 2018 22:39:07 +0200 Subject: [PATCH] removed default_data_dir() and default_cache_dir() components/config/basedir.rs --- components/config/basedir.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/components/config/basedir.rs b/components/config/basedir.rs index 0bc0446f8bc..2f634448b34 100644 --- a/components/config/basedir.rs +++ b/components/config/basedir.rs @@ -31,40 +31,6 @@ pub fn default_config_dir() -> PathBuf { PathBuf::from(dir.to_str().unwrap()) } -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))] -pub fn default_data_dir() -> Option { - let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); - let data_dir = xdg_dirs.get_data_home(); - Some(data_dir) -} - -#[cfg(target_os = "android")] -#[allow(unsafe_code)] -pub fn default_data_dir() -> Option { - let dir = unsafe { - CStr::from_ptr((*android_injected_glue::get_app().activity).internalDataPath) - }; - Some(PathBuf::from(dir.to_str().unwrap())) -} - -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))] -pub fn default_cache_dir() -> Option { - let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); - let cache_dir = xdg_dirs.get_cache_home(); - Some(cache_dir) -} - -#[cfg(target_os = "android")] -#[allow(unsafe_code)] -pub fn default_cache_dir() -> Option { - // TODO: Use JNI to call context.getCacheDir(). - // There is no equivalent function in NDK/NativeActivity. - let dir = unsafe { - CStr::from_ptr((*android_injected_glue::get_app().activity).externalDataPath) - }; - Some(PathBuf::from(dir.to_str().unwrap())) -} - #[cfg(target_os = "macos")] pub fn default_config_dir() -> PathBuf { let mut config_dir = env::home_dir().unwrap();