diff options
Diffstat (limited to 'editor/editor_feature_profile.cpp')
-rw-r--r-- | editor/editor_feature_profile.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 2222a5e5d3..2ca91043e1 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -310,7 +310,7 @@ EditorFeatureProfile::EditorFeatureProfile() {} void EditorFeatureProfileManager::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { current_profile = EDITOR_GET("_default_feature_profile"); - if (current_profile != String()) { + 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) { @@ -334,7 +334,7 @@ String EditorFeatureProfileManager::_get_selected_profile() { void EditorFeatureProfileManager::_update_profile_list(const String &p_select_profile) { String selected_profile; - if (p_select_profile == String()) { //default, keep + if (p_select_profile.is_empty()) { //default, keep if (profile_list->get_selected() >= 0) { selected_profile = profile_list->get_item_metadata(profile_list->get_selected()); if (!FileAccess::exists(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(selected_profile + ".profile"))) { @@ -352,7 +352,7 @@ void EditorFeatureProfileManager::_update_profile_list(const String &p_select_pr d->list_dir_begin(); while (true) { String f = d->get_next(); - if (f == String()) { + if (f.is_empty()) { break; } @@ -371,7 +371,7 @@ void EditorFeatureProfileManager::_update_profile_list(const String &p_select_pr for (int i = 0; i < profiles.size(); i++) { String name = profiles[i]; - if (i == 0 && selected_profile == String()) { + if (i == 0 && selected_profile.is_empty()) { selected_profile = name; } @@ -386,15 +386,15 @@ void EditorFeatureProfileManager::_update_profile_list(const String &p_select_pr } } - class_list_vbc->set_visible(selected_profile != String()); - property_list_vbc->set_visible(selected_profile != String()); - no_profile_selected_help->set_visible(selected_profile == String()); - profile_actions[PROFILE_CLEAR]->set_disabled(current_profile == String()); - profile_actions[PROFILE_ERASE]->set_disabled(selected_profile == String()); - profile_actions[PROFILE_EXPORT]->set_disabled(selected_profile == String()); - profile_actions[PROFILE_SET]->set_disabled(selected_profile == String()); + class_list_vbc->set_visible(!selected_profile.is_empty()); + property_list_vbc->set_visible(!selected_profile.is_empty()); + no_profile_selected_help->set_visible(selected_profile.is_empty()); + profile_actions[PROFILE_CLEAR]->set_disabled(current_profile.is_empty()); + profile_actions[PROFILE_ERASE]->set_disabled(selected_profile.is_empty()); + profile_actions[PROFILE_EXPORT]->set_disabled(selected_profile.is_empty()); + profile_actions[PROFILE_SET]->set_disabled(selected_profile.is_empty()); - current_profile_name->set_text(current_profile != String() ? current_profile : TTR("(none)")); + current_profile_name->set_text(!current_profile.is_empty() ? current_profile : TTR("(none)")); _update_selected_profile(); } @@ -412,7 +412,7 @@ void EditorFeatureProfileManager::_profile_action(int p_action) { } break; case PROFILE_SET: { String selected = _get_selected_profile(); - ERR_FAIL_COND(selected == String()); + ERR_FAIL_COND(selected.is_empty()); if (selected == current_profile) { return; // Nothing to do here. } @@ -438,7 +438,7 @@ void EditorFeatureProfileManager::_profile_action(int p_action) { } break; case PROFILE_ERASE: { String selected = _get_selected_profile(); - ERR_FAIL_COND(selected == String()); + ERR_FAIL_COND(selected.is_empty()); erase_profile_dialog->set_text(vformat(TTR("Remove currently selected profile, '%s'? Cannot be undone."), selected)); erase_profile_dialog->popup_centered(Size2(240, 60) * EDSCALE); @@ -448,7 +448,7 @@ void EditorFeatureProfileManager::_profile_action(int p_action) { void EditorFeatureProfileManager::_erase_selected_profile() { String selected = _get_selected_profile(); - ERR_FAIL_COND(selected == String()); + ERR_FAIL_COND(selected.is_empty()); DirAccessRef da = DirAccess::open(EditorSettings::get_singleton()->get_feature_profiles_dir()); ERR_FAIL_COND_MSG(!da, "Cannot open directory '" + EditorSettings::get_singleton()->get_feature_profiles_dir() + "'."); @@ -718,7 +718,7 @@ void EditorFeatureProfileManager::_update_selected_profile() { class_list->clear(); String profile = _get_selected_profile(); - if (profile == String()) { //nothing selected, nothing edited + if (profile.is_empty()) { //nothing selected, nothing edited property_list->clear(); edited.unref(); return; @@ -822,7 +822,7 @@ void EditorFeatureProfileManager::_export_profile(const String &p_path) { void EditorFeatureProfileManager::_save_and_update() { String edited_path = _get_selected_profile(); - ERR_FAIL_COND(edited_path == String()); + ERR_FAIL_COND(edited_path.is_empty()); ERR_FAIL_COND(edited.is_null()); edited->save_to_file(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(edited_path + ".profile")); @@ -948,7 +948,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { Ref<StyleBoxEmpty> sb = memnew(StyleBoxEmpty); sb->set_default_margin(SIDE_TOP, 20 * EDSCALE); no_profile_selected_help->add_theme_style_override("normal", sb); - no_profile_selected_help->set_align(Label::ALIGN_CENTER); + no_profile_selected_help->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); no_profile_selected_help->set_v_size_flags(Control::SIZE_EXPAND_FILL); h_split->add_child(no_profile_selected_help); |