mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 19:58:11 +08:00
Desktop: Use the OS temp directory for CEF caches (#4030)
* Desktop: Use the OS temp dir * Review
This commit is contained in:
@@ -98,6 +98,8 @@ impl PersistentData {
|
||||
}
|
||||
|
||||
pub(crate) fn load_from_disk(&mut self) {
|
||||
delete_old_cef_browser_directory();
|
||||
|
||||
let path = Self::state_file_path();
|
||||
let data = match std::fs::read_to_string(&path) {
|
||||
Ok(d) => d,
|
||||
@@ -157,3 +159,11 @@ impl PersistentData {
|
||||
path
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Eventually remove this cleanup code for the old "browser" CEF directory
|
||||
fn delete_old_cef_browser_directory() {
|
||||
let old_browser_dir = crate::dirs::app_data_dir().join("browser");
|
||||
if old_browser_dir.is_dir() {
|
||||
let _ = std::fs::remove_dir_all(&old_browser_dir);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user