diff options
| author | Rémi Verschelde | 2017-11-17 17:11:41 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-11-19 20:54:24 +0100 |
| commit | 32c12a92a5633678921ee9e43f72eb3b59a635ed (patch) | |
| tree | 17170a81fb6e47ee189a8bb86ff58a691e7ab142 /drivers/unix/os_unix.cpp | |
| parent | ad199c396478a7165da1eb6909ccb28f124b0240 (diff) | |
| download | godot-32c12a92a5633678921ee9e43f72eb3b59a635ed.tar.gz godot-32c12a92a5633678921ee9e43f72eb3b59a635ed.tar.zst godot-32c12a92a5633678921ee9e43f72eb3b59a635ed.zip | |
Diffstat (limited to 'drivers/unix/os_unix.cpp')
| -rw-r--r-- | drivers/unix/os_unix.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index e67de16ae..ce0967af2 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -456,30 +456,19 @@ int OS_Unix::get_processor_count() const { String OS_Unix::get_user_data_dir() const { - String an = get_safe_application_name(); - if (an != "") { - - if (has_environment("HOME")) { - - bool use_godot = ProjectSettings::get_singleton()->get("application/config/use_shared_user_dir"); - if (use_godot) - return get_environment("HOME") + "/.godot/app_userdata/" + an; - else - return get_environment("HOME") + "/." + an; + String appname = get_safe_application_name(); + if (appname != "") { + bool use_godot_dir = ProjectSettings::get_singleton()->get("application/config/use_shared_user_dir"); + if (use_godot_dir) { + return get_data_path().plus_file(get_godot_dir_name()).plus_file("app_userdata").plus_file(appname); + } else { + return get_data_path().plus_file(appname); } } return ProjectSettings::get_singleton()->get_resource_path(); } -String OS_Unix::get_installed_templates_path() const { - String p = get_global_settings_path(); - if (p != "") - return p + "/templates/"; - else - return ""; -} - String OS_Unix::get_executable_path() const { #ifdef __linux__ |
