@@ -590,42 +590,42 @@ void DependencyRemoveDialog::ok_pressed() {
590
590
}
591
591
592
592
bool project_settings_modified = false ;
593
- for (int i = 0 ; i < files_to_delete. size (); ++i ) {
593
+ for (const String &file : files_to_delete) {
594
594
// If the file we are deleting for e.g. the main scene, default environment,
595
595
// or audio bus layout, we must clear its definition in Project Settings.
596
- if (files_to_delete[i] == String (GLOBAL_GET (" application/config/icon" ))) {
596
+ if (file == ResourceUID::ensure_path (GLOBAL_GET (" application/config/icon" ))) {
597
597
ProjectSettings::get_singleton ()->set (" application/config/icon" , " " );
598
598
project_settings_modified = true ;
599
- } else if (files_to_delete[i] == String (GLOBAL_GET (" application/run/main_scene" ))) {
599
+ } else if (file == ResourceUID::ensure_path (GLOBAL_GET (" application/run/main_scene" ))) {
600
600
ProjectSettings::get_singleton ()->set (" application/run/main_scene" , " " );
601
601
project_settings_modified = true ;
602
- } else if (files_to_delete[i] == String (GLOBAL_GET (" application/boot_splash/image" ))) {
602
+ } else if (file == ResourceUID::ensure_path (GLOBAL_GET (" application/boot_splash/image" ))) {
603
603
ProjectSettings::get_singleton ()->set (" application/boot_splash/image" , " " );
604
604
project_settings_modified = true ;
605
- } else if (files_to_delete[i] == String (GLOBAL_GET (" rendering/environment/defaults/default_environment" ))) {
605
+ } else if (file == ResourceUID::ensure_path (GLOBAL_GET (" rendering/environment/defaults/default_environment" ))) {
606
606
ProjectSettings::get_singleton ()->set (" rendering/environment/defaults/default_environment" , " " );
607
607
project_settings_modified = true ;
608
- } else if (files_to_delete[i] == String (GLOBAL_GET (" display/mouse_cursor/custom_image" ))) {
608
+ } else if (file == ResourceUID::ensure_path (GLOBAL_GET (" display/mouse_cursor/custom_image" ))) {
609
609
ProjectSettings::get_singleton ()->set (" display/mouse_cursor/custom_image" , " " );
610
610
project_settings_modified = true ;
611
- } else if (files_to_delete[i] == String (GLOBAL_GET (" gui/theme/custom" ))) {
611
+ } else if (file == ResourceUID::ensure_path (GLOBAL_GET (" gui/theme/custom" ))) {
612
612
ProjectSettings::get_singleton ()->set (" gui/theme/custom" , " " );
613
613
project_settings_modified = true ;
614
- } else if (files_to_delete[i] == String (GLOBAL_GET (" gui/theme/custom_font" ))) {
614
+ } else if (file == ResourceUID::ensure_path (GLOBAL_GET (" gui/theme/custom_font" ))) {
615
615
ProjectSettings::get_singleton ()->set (" gui/theme/custom_font" , " " );
616
616
project_settings_modified = true ;
617
- } else if (files_to_delete[i] == String (GLOBAL_GET (" audio/buses/default_bus_layout" ))) {
617
+ } else if (file == ResourceUID::ensure_path (GLOBAL_GET (" audio/buses/default_bus_layout" ))) {
618
618
ProjectSettings::get_singleton ()->set (" audio/buses/default_bus_layout" , " " );
619
619
project_settings_modified = true ;
620
620
}
621
621
622
- String path = OS::get_singleton ()->get_resource_dir () + files_to_delete[i] .replace_first (" res://" , " /" );
622
+ const String path = OS::get_singleton ()->get_resource_dir () + file .replace_first (" res://" , " /" );
623
623
print_verbose (" Moving to trash: " + path);
624
624
Error err = OS::get_singleton ()->move_to_trash (path);
625
625
if (err != OK) {
626
- EditorNode::get_singleton ()->add_io_error (TTR (" Cannot remove:" ) + " \n " + files_to_delete[i] + " \n " );
626
+ EditorNode::get_singleton ()->add_io_error (TTR (" Cannot remove:" ) + " \n " + file + " \n " );
627
627
} else {
628
- emit_signal (SNAME (" file_removed" ), files_to_delete[i] );
628
+ emit_signal (SNAME (" file_removed" ), file );
629
629
}
630
630
}
631
631
if (project_settings_modified) {
0 commit comments