diff options
Diffstat (limited to 'core/os/os.cpp')
-rw-r--r-- | core/os/os.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index 5704ef7a40..38ea4a0fdd 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -295,12 +295,14 @@ Error OS::shell_open(String p_uri) { } Error OS::shell_show_in_file_manager(String p_path, bool p_open_folder) { - if (!p_path.begins_with("file://")) { - p_path = String("file://") + p_path; - } - if (!p_path.ends_with("/")) { + p_path = p_path.trim_prefix("file://"); + + if (!DirAccess::dir_exists_absolute(p_path)) { p_path = p_path.get_base_dir(); } + + p_path = String("file://") + p_path; + return shell_open(p_path); } // implement these with the canvas? @@ -503,6 +505,10 @@ bool OS::has_feature(const String &p_feature) { return false; } +bool OS::is_sandboxed() const { + return false; +} + void OS::set_restart_on_exit(bool p_restart, const List<String> &p_restart_arguments) { restart_on_exit = p_restart; restart_commandline = p_restart_arguments; |