You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add initial support for the XDG Base Directory spec
Spec version 0.7 from https://standards.freedesktop.org/basedir-spec/basedir-spec-0.7.html (latest as of this commit). Three virtual methods are added to OS for the various XDG paths we will use: - OS::get_data_path gives XDG_DATA_HOME, or if missing: ~/.local/share on X11, ~/Library/Application Support/ on macOS and %APPDATA% on Windows - OS::get_config_path gives XDG_CONFIG_HOME, or if missing: ~/.config on X11, ~/Library/Application Support/ on macOS and %APPDATA% on Windows - OS::get_cache_path gives XDG_CACHE_HOME, or if missing: ~/.cache on X11, ~/Library/Caches on macOS and %APPDATA% on Windows So for Windows there are no changes, for Linux we follow the full split spec and for macOS stuff will move from ~/.godot to ~/Library/Application Support/Godot. Support for system-wide installation of templates on Unix was removed for now, as it's a bit hackish and I don't think anyone uses it. user:// will still be OS::get_data_path() + "/godot/app_userdata/$name" by default, but when using the application/config/use_shared_user_dir option it will now use XDG_DATA_HOME/$name, e.g. ~/.local/share/MyGame. For now everything still goes in EditorSettings::get_settings_dir(), but this will be changed in a later commit to make use of the new splitting where relevant. Part of #3513.
This commit is contained in:
@@ -57,7 +57,7 @@ String _get_expected_build_config() {
|
||||
String _get_mono_user_dir() {
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (EditorSettings::get_singleton()) {
|
||||
return EditorSettings::get_singleton()->get_settings_dir().plus_file("mono");
|
||||
return EditorSettings::get_singleton()->get_data_dir().plus_file("mono");
|
||||
} else {
|
||||
String settings_path;
|
||||
|
||||
@@ -68,13 +68,7 @@ String _get_mono_user_dir() {
|
||||
// contain yourself
|
||||
settings_path = exe_dir.plus_file("editor_data");
|
||||
} else {
|
||||
if (OS::get_singleton()->has_environment("APPDATA")) {
|
||||
String app_data = OS::get_singleton()->get_environment("APPDATA").replace("\\", "/");
|
||||
settings_path = app_data.plus_file(String(_MKSTR(VERSION_SHORT_NAME)).capitalize());
|
||||
} else if (OS::get_singleton()->has_environment("HOME")) {
|
||||
String home = OS::get_singleton()->get_environment("HOME");
|
||||
settings_path = home.plus_file("." + String(_MKSTR(VERSION_SHORT_NAME)).to_lower());
|
||||
}
|
||||
settings_path = OS::get_singleton()->get_data_path().plus_file(OS::get_singleton()->get_godot_dir_name());
|
||||
}
|
||||
|
||||
return settings_path.plus_file("mono");
|
||||
|
||||
Reference in New Issue
Block a user