mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Merge pull request #98397 from adamscott/add-tmp-support
Add temp utilities (alias `OS::get_temp_dir()`, `FileAccess::create_temp()`, and `DirAccess::create_temp()`)
This commit is contained in:
@@ -54,6 +54,10 @@ String EditorPaths::get_cache_dir() const {
|
||||
return cache_dir;
|
||||
}
|
||||
|
||||
String EditorPaths::get_temp_dir() const {
|
||||
return temp_dir;
|
||||
}
|
||||
|
||||
String EditorPaths::get_project_data_dir() const {
|
||||
return project_data_dir;
|
||||
}
|
||||
@@ -161,6 +165,7 @@ EditorPaths::EditorPaths() {
|
||||
config_dir = data_dir;
|
||||
cache_path = exe_path;
|
||||
cache_dir = data_dir.path_join("cache");
|
||||
temp_dir = data_dir.path_join("temp");
|
||||
} else {
|
||||
// Typically XDG_DATA_HOME or %APPDATA%.
|
||||
data_path = OS::get_singleton()->get_data_path();
|
||||
@@ -175,6 +180,7 @@ EditorPaths::EditorPaths() {
|
||||
} else {
|
||||
cache_dir = cache_path.path_join(OS::get_singleton()->get_godot_dir_name());
|
||||
}
|
||||
temp_dir = OS::get_singleton()->get_temp_path();
|
||||
}
|
||||
|
||||
paths_valid = (!data_path.is_empty() && !config_path.is_empty() && !cache_path.is_empty());
|
||||
|
||||
Reference in New Issue
Block a user