summaryrefslogtreecommitdiff
path: root/editor/property_selector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/property_selector.cpp')
-rw-r--r--editor/property_selector.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index f167ded4e7..3b0cbfdde9 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -44,10 +44,10 @@ void PropertySelector::_sbox_input(const Ref<InputEvent> &p_ie) {
if (k.is_valid()) {
switch (k->get_keycode()) {
- case KEY_UP:
- case KEY_DOWN:
- case KEY_PAGEUP:
- case KEY_PAGEDOWN: {
+ case Key::UP:
+ case Key::DOWN:
+ case Key::PAGEUP:
+ case Key::PAGEDOWN: {
search_options->gui_input(k);
search_box->accept_event();
@@ -181,7 +181,7 @@ void PropertySelector::_update_search() {
continue;
}
- if (search_box->get_text() != String() && E.name.findn(search_text) == -1) {
+ if (!search_box->get_text().is_empty() && E.name.findn(search_text) == -1) {
continue;
}
@@ -194,7 +194,7 @@ void PropertySelector::_update_search() {
item->set_metadata(0, E.name);
item->set_icon(0, type_icons[E.type]);
- if (!found && search_box->get_text() != String() && E.name.findn(search_text) != -1) {
+ if (!found && !search_box->get_text().is_empty() && E.name.findn(search_text) != -1) {
item->select(0);
found = true;
}
@@ -269,7 +269,7 @@ void PropertySelector::_update_search() {
continue;
}
- if (search_box->get_text() != String() && name.findn(search_text) == -1) {
+ if (!search_box->get_text().is_empty() && name.findn(search_text) == -1) {
continue;
}
@@ -318,7 +318,7 @@ void PropertySelector::_update_search() {
item->set_metadata(0, name);
item->set_selectable(0, true);
- if (!found && search_box->get_text() != String() && name.findn(search_text) != -1) {
+ if (!found && !search_box->get_text().is_empty() && name.findn(search_text) != -1) {
item->select(0);
found = true;
}
@@ -353,7 +353,7 @@ void PropertySelector::_item_selected() {
String class_type;
if (type != Variant::NIL) {
class_type = Variant::get_type_name(type);
- } else if (base_type != String()) {
+ } else if (!base_type.is_empty()) {
class_type = base_type;
} else if (instance) {
class_type = instance->get_class();
@@ -362,7 +362,7 @@ void PropertySelector::_item_selected() {
DocTools *dd = EditorHelp::get_doc_data();
String text;
if (properties) {
- while (class_type != String()) {
+ while (!class_type.is_empty()) {
Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(class_type);
if (E) {
for (int i = 0; i < E->get().properties.size(); i++) {
@@ -373,7 +373,7 @@ void PropertySelector::_item_selected() {
}
}
- if (text != String()) {
+ if (!text.is_empty()) {
break;
}
@@ -381,7 +381,7 @@ void PropertySelector::_item_selected() {
class_type = ClassDB::get_parent_class(class_type);
}
} else {
- while (class_type != String()) {
+ while (!class_type.is_empty()) {
Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(class_type);
if (E) {
for (int i = 0; i < E->get().methods.size(); i++) {
@@ -392,7 +392,7 @@ void PropertySelector::_item_selected() {
}
}
- if (text != String()) {
+ if (!text.is_empty()) {
break;
}
@@ -401,7 +401,7 @@ void PropertySelector::_item_selected() {
}
}
- if (text != String()) {
+ if (!text.is_empty()) {
// Display both property name and description, since the help bit may be displayed
// far away from the location (especially if the dialog was resized to be taller).
help_bit->set_text(vformat("[b]%s[/b]: %s", name, text));