aboutsummaryrefslogtreecommitdiff
path: root/platform/x11/os_x11.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2017-11-17 17:11:41 +0100
committerRémi Verschelde2017-11-19 20:54:24 +0100
commit32c12a92a5633678921ee9e43f72eb3b59a635ed (patch)
tree17170a81fb6e47ee189a8bb86ff58a691e7ab142 /platform/x11/os_x11.cpp
parentad199c396478a7165da1eb6909ccb28f124b0240 (diff)
downloadgodot-32c12a92a5633678921ee9e43f72eb3b59a635ed.tar.gz
godot-32c12a92a5633678921ee9e43f72eb3b59a635ed.tar.zst
godot-32c12a92a5633678921ee9e43f72eb3b59a635ed.zip
Diffstat (limited to 'platform/x11/os_x11.cpp')
-rw-r--r--platform/x11/os_x11.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 412e22b5f..c1d744215 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1941,6 +1941,39 @@ bool OS_X11::_check_internal_feature_support(const String &p_feature) {
return p_feature == "pc" || p_feature == "s3tc";
}
+String OS_X11::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_X11::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_X11::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();
+ }
+}
+
String OS_X11::get_system_dir(SystemDir p_dir) const {
String xdgparam;