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 /platform/haiku/os_haiku.cpp | |
| parent | ad199c396478a7165da1eb6909ccb28f124b0240 (diff) | |
| download | godot-32c12a92a5633678921ee9e43f72eb3b59a635ed.tar.gz godot-32c12a92a5633678921ee9e43f72eb3b59a635ed.tar.zst godot-32c12a92a5633678921ee9e43f72eb3b59a635ed.zip | |
Diffstat (limited to 'platform/haiku/os_haiku.cpp')
| -rw-r--r-- | platform/haiku/os_haiku.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index 0c34e3965..4d5dfeddb 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -314,3 +314,36 @@ bool OS_Haiku::_check_internal_feature_support(const String &p_feature) { return p_feature == "pc" || p_feature == "s3tc"; } + +String OS_Haiku::get_config_path() const { + + if (has_environment("XDG_CONFIG_HOME")) { + return get_environment("XDG_CONFIG_HOME"); + } else if (has_environment("HOME")) { + return get_environment("HOME").plus_file(".config"); + } else { + return "."; + } +} + +String OS_Haiku::get_data_path() const { + + if (has_environment("XDG_DATA_HOME")) { + return get_environment("XDG_DATA_HOME"); + } else if (has_environment("HOME")) { + return get_environment("HOME").plus_file(".local/share"); + } else { + return get_config_path(); + } +} + +String OS_Haiku::get_cache_path() const { + + if (has_environment("XDG_CACHE_HOME")) { + return get_environment("XDG_CACHE_HOME"); + } else if (has_environment("HOME")) { + return get_environment("HOME").plus_file(".cache"); + } else { + return get_config_path(); + } +} |
