Merge pull request #12988 from akien-mga/xdg-home-paths

Add support for XDG Base Directory spec
This commit is contained in:
Rémi Verschelde
2017-11-20 00:42:51 +01:00
committed by GitHub
49 changed files with 498 additions and 262 deletions

View File

@@ -505,7 +505,7 @@ uint32_t NetworkedMultiplayerENet::_gen_unique_id() const {
hash = hash_djb2_one_32(
(uint32_t)OS::get_singleton()->get_unix_time(), hash);
hash = hash_djb2_one_32(
(uint32_t)OS::get_singleton()->get_data_dir().hash64(), hash);
(uint32_t)OS::get_singleton()->get_user_data_dir().hash64(), hash);
/*
hash = hash_djb2_one_32(
(uint32_t)OS::get_singleton()->get_unique_id().hash64(), hash );

View File

@@ -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_path().plus_file("mono");
return EditorSettings::get_singleton()->get_data_dir().plus_file("mono");
} else {
String settings_path;
@@ -68,19 +68,13 @@ 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");
}
#else
return OS::get_singleton()->get_data_dir().plus_file("mono");
return OS::get_singleton()->get_user_data_dir().plus_file("mono");
#endif
}