diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2022-04-27 07:55:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-27 07:55:33 +0200 |
| commit | 8121db871ad038444bd77ef2918cfc5b731e45f3 (patch) | |
| tree | 0b50593cd1074ae958514abd6feb43d5307503ba /core | |
| parent | 14caf9ee73e10ac857021538be356dbc84993411 (diff) | |
| parent | b80e52f04899d28ea191ce3eaad9fdb76bc11b52 (diff) | |
Merge pull request #60542 from KoBeWi/garbage
Expose `move_to_trash()`
Diffstat (limited to 'core')
| -rw-r--r-- | core/core_bind.cpp | 5 | ||||
| -rw-r--r-- | core/core_bind.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 892b74c26a..8308c4fe53 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -483,6 +483,10 @@ void OS::dump_resources_to_file(const String &p_file) { ::OS::get_singleton()->dump_resources_to_file(p_file.utf8().get_data()); } +Error OS::move_to_trash(const String &p_path) const { + return ::OS::get_singleton()->move_to_trash(p_path); +} + String OS::get_user_data_dir() const { return ::OS::get_singleton()->get_user_data_dir(); } @@ -597,6 +601,7 @@ void OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_static_memory_usage"), &OS::get_static_memory_usage); ClassDB::bind_method(D_METHOD("get_static_memory_peak_usage"), &OS::get_static_memory_peak_usage); + ClassDB::bind_method(D_METHOD("move_to_trash", "path"), &OS::move_to_trash); ClassDB::bind_method(D_METHOD("get_user_data_dir"), &OS::get_user_data_dir); ClassDB::bind_method(D_METHOD("get_system_dir", "dir", "shared_storage"), &OS::get_system_dir, DEFVAL(true)); ClassDB::bind_method(D_METHOD("get_config_dir"), &OS::get_config_dir); diff --git a/core/core_bind.h b/core/core_bind.h index 591cacdabb..bc68be3f62 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -235,6 +235,7 @@ public: String get_system_dir(SystemDir p_dir, bool p_shared_storage = true) const; + Error move_to_trash(const String &p_path) const; String get_user_data_dir() const; String get_config_dir() const; String get_data_dir() const; |