Port existing _notification code to use switch statements (part 1/3)

This commit is contained in:
jmb462
2022-02-16 00:52:32 +01:00
committed by Jean-Michel Bernard
parent f5b9cbaff6
commit dcd2a92af3
39 changed files with 1836 additions and 1666 deletions

View File

@ -309,18 +309,20 @@ EditorFeatureProfile::EditorFeatureProfile() {}
//////////////////////////
void EditorFeatureProfileManager::_notification(int p_what) {
if (p_what == NOTIFICATION_READY) {
current_profile = EDITOR_GET("_default_feature_profile");
if (!current_profile.is_empty()) {
current.instantiate();
Error err = current->load_from_file(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(current_profile + ".profile"));
if (err != OK) {
ERR_PRINT("Error loading default feature profile: " + current_profile);
current_profile = String();
current.unref();
switch (p_what) {
case NOTIFICATION_READY: {
current_profile = EDITOR_GET("_default_feature_profile");
if (!current_profile.is_empty()) {
current.instantiate();
Error err = current->load_from_file(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(current_profile + ".profile"));
if (err != OK) {
ERR_PRINT("Error loading default feature profile: " + current_profile);
current_profile = String();
current.unref();
}
}
}
_update_profile_list(current_profile);
_update_profile_list(current_profile);
} break;
}
}