diff options
Diffstat (limited to 'editor/dependency_editor.cpp')
-rw-r--r-- | editor/dependency_editor.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 54bf31cd62..5305c4f256 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -409,17 +409,22 @@ void DependencyRemoveDialog::show(const Vector<String> &to_erase) { void DependencyRemoveDialog::ok_pressed() { - DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); + bool changed = false; + for (Map<String, TreeItem *>::Element *E = files.front(); E; E = E->next()) { if (ResourceCache::has(E->key())) { Resource *res = ResourceCache::get(E->key()); res->set_path(""); //clear reference to path } - da->remove(E->key()); - EditorFileSystem::get_singleton()->update_file(E->key()); + String fpath = OS::get_singleton()->get_resource_dir() + E->key().replace_first("res://", "/"); + OS::get_singleton()->move_to_trash(fpath); + changed = true; + } + + if (changed) { + EditorFileSystem::get_singleton()->scan_changes(); } - memdelete(da); } DependencyRemoveDialog::DependencyRemoveDialog() { |