summaryrefslogtreecommitdiffstats
path: root/core/os/os.cpp
diff options
context:
space:
mode:
authorDaylily-Zeleen <daylily-zeleen@foxmail.com>2022-12-07 11:33:35 +0800
committerDaylily-Zeleen <daylily-zeleen@foxmail.com>2023-04-25 11:29:32 +0800
commitb12ced0a2693d4983e08716005d4a854fce116f1 (patch)
tree67b799386354d016777ecb2a43e9e43372405632 /core/os/os.cpp
parent6f1a52b017930afb851691e6852ce40eb93c30a9 (diff)
downloadredot-engine-b12ced0a2693d4983e08716005d4a854fce116f1.tar.gz
Implement and expose OS::shell_show_in_file_manager()
Diffstat (limited to 'core/os/os.cpp')
-rw-r--r--core/os/os.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp
index ef7d860d19..7b6c8dc1ca 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -281,6 +281,15 @@ Error OS::shell_open(String p_uri) {
return ERR_UNAVAILABLE;
}
+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.get_base_dir();
+ }
+ return shell_open(p_path);
+}
// implement these with the canvas?
uint64_t OS::get_static_memory_usage() const {