Skip to content

Commit aaffffc

Browse files
committed
Merge pull request godotengine#97817 from bruvzg/prop_warn_remove
Partially revert godotengine#96780, remove warnings from project/editor settings `_get`.
2 parents 41c55f0 + 794920b commit aaffffc

File tree

4 files changed

+54
-62
lines changed

4 files changed

+54
-62
lines changed

core/config/project_settings.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ bool ProjectSettings::_get(const StringName &p_name, Variant &r_ret) const {
348348
_THREAD_SAFE_METHOD_
349349

350350
if (!props.has(p_name)) {
351-
WARN_PRINT("Property not found: " + String(p_name));
352351
return false;
353352
}
354353
r_ret = props[p_name].variant;

core/io/resource_format_binary.cpp

+18-20
Original file line numberDiff line numberDiff line change
@@ -845,29 +845,27 @@ Error ResourceLoaderBinary::load() {
845845
}
846846
}
847847

848-
if (ClassDB::has_property(res->get_class_name(), name)) {
849-
if (value.get_type() == Variant::ARRAY) {
850-
Array set_array = value;
851-
bool is_get_valid = false;
852-
Variant get_value = res->get(name, &is_get_valid);
853-
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
854-
Array get_array = get_value;
855-
if (!set_array.is_same_typed(get_array)) {
856-
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
857-
}
848+
if (value.get_type() == Variant::ARRAY) {
849+
Array set_array = value;
850+
bool is_get_valid = false;
851+
Variant get_value = res->get(name, &is_get_valid);
852+
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
853+
Array get_array = get_value;
854+
if (!set_array.is_same_typed(get_array)) {
855+
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
858856
}
859857
}
858+
}
860859

861-
if (value.get_type() == Variant::DICTIONARY) {
862-
Dictionary set_dict = value;
863-
bool is_get_valid = false;
864-
Variant get_value = res->get(name, &is_get_valid);
865-
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
866-
Dictionary get_dict = get_value;
867-
if (!set_dict.is_same_typed(get_dict)) {
868-
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
869-
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
870-
}
860+
if (value.get_type() == Variant::DICTIONARY) {
861+
Dictionary set_dict = value;
862+
bool is_get_valid = false;
863+
Variant get_value = res->get(name, &is_get_valid);
864+
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
865+
Dictionary get_dict = get_value;
866+
if (!set_dict.is_same_typed(get_dict)) {
867+
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
868+
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
871869
}
872870
}
873871
}

editor/editor_settings.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const {
221221

222222
const VariantContainer *v = props.getptr(p_name);
223223
if (!v) {
224-
WARN_PRINT("EditorSettings::_get - Property not found: " + String(p_name));
225224
return false;
226225
}
227226
r_ret = v->variant;

scene/resources/resource_format_text.cpp

+36-40
Original file line numberDiff line numberDiff line change
@@ -612,29 +612,27 @@ Error ResourceLoaderText::load() {
612612
}
613613
}
614614

615-
if (ClassDB::has_property(res->get_class_name(), assign)) {
616-
if (value.get_type() == Variant::ARRAY) {
617-
Array set_array = value;
618-
bool is_get_valid = false;
619-
Variant get_value = res->get(assign, &is_get_valid);
620-
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
621-
Array get_array = get_value;
622-
if (!set_array.is_same_typed(get_array)) {
623-
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
624-
}
615+
if (value.get_type() == Variant::ARRAY) {
616+
Array set_array = value;
617+
bool is_get_valid = false;
618+
Variant get_value = res->get(assign, &is_get_valid);
619+
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
620+
Array get_array = get_value;
621+
if (!set_array.is_same_typed(get_array)) {
622+
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
625623
}
626624
}
625+
}
627626

628-
if (value.get_type() == Variant::DICTIONARY) {
629-
Dictionary set_dict = value;
630-
bool is_get_valid = false;
631-
Variant get_value = res->get(assign, &is_get_valid);
632-
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
633-
Dictionary get_dict = get_value;
634-
if (!set_dict.is_same_typed(get_dict)) {
635-
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
636-
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
637-
}
627+
if (value.get_type() == Variant::DICTIONARY) {
628+
Dictionary set_dict = value;
629+
bool is_get_valid = false;
630+
Variant get_value = res->get(assign, &is_get_valid);
631+
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
632+
Dictionary get_dict = get_value;
633+
if (!set_dict.is_same_typed(get_dict)) {
634+
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
635+
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
638636
}
639637
}
640638
}
@@ -754,29 +752,27 @@ Error ResourceLoaderText::load() {
754752
}
755753
}
756754

757-
if (ClassDB::has_property(resource->get_class_name(), assign)) {
758-
if (value.get_type() == Variant::ARRAY) {
759-
Array set_array = value;
760-
bool is_get_valid = false;
761-
Variant get_value = resource->get(assign, &is_get_valid);
762-
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
763-
Array get_array = get_value;
764-
if (!set_array.is_same_typed(get_array)) {
765-
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
766-
}
755+
if (value.get_type() == Variant::ARRAY) {
756+
Array set_array = value;
757+
bool is_get_valid = false;
758+
Variant get_value = resource->get(assign, &is_get_valid);
759+
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
760+
Array get_array = get_value;
761+
if (!set_array.is_same_typed(get_array)) {
762+
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
767763
}
768764
}
765+
}
769766

770-
if (value.get_type() == Variant::DICTIONARY) {
771-
Dictionary set_dict = value;
772-
bool is_get_valid = false;
773-
Variant get_value = resource->get(assign, &is_get_valid);
774-
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
775-
Dictionary get_dict = get_value;
776-
if (!set_dict.is_same_typed(get_dict)) {
777-
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
778-
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
779-
}
767+
if (value.get_type() == Variant::DICTIONARY) {
768+
Dictionary set_dict = value;
769+
bool is_get_valid = false;
770+
Variant get_value = resource->get(assign, &is_get_valid);
771+
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
772+
Dictionary get_dict = get_value;
773+
if (!set_dict.is_same_typed(get_dict)) {
774+
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
775+
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
780776
}
781777
}
782778
}

0 commit comments

Comments
 (0)