Merge pull request #18800 from dragmz/removefile
fix for removing files
This commit is contained in:
commit
d5a0d653c8
@ -504,12 +504,6 @@ void DependencyRemoveDialog::show(const Vector<String> &p_folders, const Vector<
|
|||||||
|
|
||||||
void DependencyRemoveDialog::ok_pressed() {
|
void DependencyRemoveDialog::ok_pressed() {
|
||||||
|
|
||||||
if (dirs_to_delete.size() == 0) {
|
|
||||||
//If we only deleted files we should only need to tell the file system about the files we touched.
|
|
||||||
for (int i = 0; i < files_to_delete.size(); ++i)
|
|
||||||
EditorFileSystem::get_singleton()->update_file(files_to_delete[i]);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
for (int i = 0; i < files_to_delete.size(); ++i) {
|
for (int i = 0; i < files_to_delete.size(); ++i) {
|
||||||
if (ResourceCache::has(files_to_delete[i])) {
|
if (ResourceCache::has(files_to_delete[i])) {
|
||||||
Resource *res = ResourceCache::get(files_to_delete[i]);
|
Resource *res = ResourceCache::get(files_to_delete[i]);
|
||||||
@ -523,6 +517,12 @@ void DependencyRemoveDialog::ok_pressed() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dirs_to_delete.size() == 0) {
|
||||||
|
//If we only deleted files we should only need to tell the file system about the files we touched.
|
||||||
|
for (int i = 0; i < files_to_delete.size(); ++i)
|
||||||
|
EditorFileSystem::get_singleton()->update_file(files_to_delete[i]);
|
||||||
|
} else {
|
||||||
|
|
||||||
for (int i = 0; i < dirs_to_delete.size(); ++i) {
|
for (int i = 0; i < dirs_to_delete.size(); ++i) {
|
||||||
String path = OS::get_singleton()->get_resource_dir() + dirs_to_delete[i].replace_first("res://", "/");
|
String path = OS::get_singleton()->get_resource_dir() + dirs_to_delete[i].replace_first("res://", "/");
|
||||||
print_line("Moving to trash: " + path);
|
print_line("Moving to trash: " + path);
|
||||||
|
Loading…
Reference in New Issue
Block a user