From 73049d115e190b8c356f0689a9079c3c73cc5765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 17 Nov 2017 15:25:22 +0100 Subject: Rename OS::get_data_dir to OS::get_user_data_dir Will be needed to avoid confusion with system data path (XDG_DATA_HOME) and editor data dir in upcoming refactoring. --- core/os/os.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/os/os.h') diff --git a/core/os/os.h b/core/os/os.h index faecdb0e07..a421833e49 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -124,7 +124,7 @@ protected: virtual void set_cmdline(const char *p_execpath, const List &p_args); - void _ensure_data_dir(); + void _ensure_user_data_dir(); virtual bool _check_internal_feature_support(const String &p_feature) = 0; public: @@ -334,7 +334,7 @@ public: virtual String get_locale() const; String get_safe_application_name() const; - virtual String get_data_dir() const; + virtual String get_user_data_dir() const; virtual String get_resource_dir() const; virtual Error move_to_trash(const String &p_path) { return FAILED; } -- cgit v1.2.3 From 32c12a92a5633678921ee9e43f72eb3b59a635ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 17 Nov 2017 17:11:41 +0100 Subject: 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. --- core/os/os.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'core/os/os.h') diff --git a/core/os/os.h b/core/os/os.h index a421833e49..474cb60627 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -200,7 +200,6 @@ public: virtual void set_low_processor_usage_mode(bool p_enabled); virtual bool is_in_low_processor_usage_mode() const; - virtual String get_installed_templates_path() const { return ""; } virtual String get_executable_path() const; virtual Error execute(const String &p_path, const List &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false) = 0; virtual Error kill(const ProcessID &p_pid) = 0; @@ -334,11 +333,15 @@ public: virtual String get_locale() const; String get_safe_application_name() const; + virtual String get_godot_dir_name() const; + + virtual String get_data_path() const; + virtual String get_config_path() const; + virtual String get_cache_path() const; + virtual String get_user_data_dir() const; virtual String get_resource_dir() const; - virtual Error move_to_trash(const String &p_path) { return FAILED; } - enum SystemDir { SYSTEM_DIR_DESKTOP, SYSTEM_DIR_DCIM, @@ -352,6 +355,8 @@ public: virtual String get_system_dir(SystemDir p_dir) const; + virtual Error move_to_trash(const String &p_path) { return FAILED; } + virtual void set_no_window_mode(bool p_enable); virtual bool is_no_window_mode_enabled() const; -- cgit v1.2.3