summaryrefslogtreecommitdiff
path: root/editor/dependency_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/dependency_editor.cpp')
-rw-r--r--editor/dependency_editor.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index a925e2d1d3..c98ec7b2d5 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -536,12 +536,17 @@ void DependencyRemoveDialog::show(const Vector<String> &p_folders, const Vector<
}
void DependencyRemoveDialog::ok_pressed() {
- for (int i = 0; i < files_to_delete.size(); ++i) {
- if (ResourceCache::has(files_to_delete[i])) {
- Ref<Resource> res = ResourceCache::get_ref(files_to_delete[i]);
+ for (const KeyValue<String, String> &E : all_remove_files) {
+ String file = E.key;
+
+ if (ResourceCache::has(file)) {
+ Ref<Resource> res = ResourceCache::get_ref(file);
+ emit_signal(SNAME("resource_removed"), res);
res->set_path("");
}
+ }
+ for (int i = 0; i < files_to_delete.size(); ++i) {
// If the file we are deleting for e.g. the main scene, default environment,
// or audio bus layout, we must clear its definition in Project Settings.
if (files_to_delete[i] == String(GLOBAL_GET("application/config/icon"))) {
@@ -621,6 +626,7 @@ void DependencyRemoveDialog::ok_pressed() {
}
void DependencyRemoveDialog::_bind_methods() {
+ ADD_SIGNAL(MethodInfo("resource_removed", PropertyInfo(Variant::OBJECT, "obj")));
ADD_SIGNAL(MethodInfo("file_removed", PropertyInfo(Variant::STRING, "file")));
ADD_SIGNAL(MethodInfo("folder_removed", PropertyInfo(Variant::STRING, "folder")));
}