Browse Source

Revert "Only update inspector if configuration warning change relevant"

This reverts commit a53793472e4ed61e68405044beb6325a33ac5814.
Rémi Verschelde 1 year ago
parent
commit
9f76398781
2 changed files with 1 additions and 46 deletions
  1. 1 44
      editor/editor_inspector.cpp
  2. 0 2
      editor/editor_inspector.h

+ 1 - 44
editor/editor_inspector.cpp

@@ -3535,9 +3535,6 @@ void EditorInspector::edit(Object *p_object) {
 
 
 	object = p_object;
 	object = p_object;
 
 
-	property_configuration_warnings.clear();
-	_update_configuration_warnings();
-
 	if (object) {
 	if (object) {
 		update_scroll_request = 0; //reset
 		update_scroll_request = 0; //reset
 		if (scroll_cache.has(object->get_instance_id())) { //if exists, set something else
 		if (scroll_cache.has(object->get_instance_id())) { //if exists, set something else
@@ -4061,48 +4058,8 @@ void EditorInspector::_node_removed(Node *p_node) {
 
 
 void EditorInspector::_warning_changed(Node *p_node) {
 void EditorInspector::_warning_changed(Node *p_node) {
 	if (p_node == object) {
 	if (p_node == object) {
-		// Only update the tree if the list of configuration warnings has changed.
-		if (_update_configuration_warnings()) {
-			update_tree_pending = true;
-		}
-	}
-}
-
-bool EditorInspector::_update_configuration_warnings() {
-	Node *node = Object::cast_to<Node>(object);
-	if (!node) {
-		return false;
-	}
-
-	bool changed = false;
-	LocalVector<int> found_warning_indices;
-
-	// New and changed warnings.
-	Vector<Dictionary> warnings = node->get_configuration_warnings_as_dicts();
-	for (const Dictionary &warning : warnings) {
-		if (!warning.has("property")) {
-			continue;
-		}
-
-		int found_warning_index = property_configuration_warnings.find(warning);
-		if (found_warning_index < 0) {
-			found_warning_index = property_configuration_warnings.size();
-			property_configuration_warnings.push_back(warning);
-			changed = true;
-		}
-		found_warning_indices.push_back(found_warning_index);
-	}
-
-	// Removed warnings.
-	for (uint32_t i = 0; i < property_configuration_warnings.size(); i++) {
-		if (found_warning_indices.find(i) < 0) {
-			property_configuration_warnings.remove_at(i);
-			i--;
-			changed = true;
-		}
+		update_tree_pending = true;
 	}
 	}
-
-	return changed;
 }
 }
 
 
 void EditorInspector::_notification(int p_what) {
 void EditorInspector::_notification(int p_what) {

+ 0 - 2
editor/editor_inspector.h

@@ -514,7 +514,6 @@ class EditorInspector : public ScrollContainer {
 	int property_focusable;
 	int property_focusable;
 	int update_scroll_request;
 	int update_scroll_request;
 
 
-	LocalVector<Dictionary> property_configuration_warnings;
 	HashMap<StringName, HashMap<StringName, String>> doc_path_cache;
 	HashMap<StringName, HashMap<StringName, String>> doc_path_cache;
 	HashSet<StringName> restart_request_props;
 	HashSet<StringName> restart_request_props;
 	HashMap<String, String> custom_property_descriptions;
 	HashMap<String, String> custom_property_descriptions;
@@ -544,7 +543,6 @@ class EditorInspector : public ScrollContainer {
 
 
 	void _node_removed(Node *p_node);
 	void _node_removed(Node *p_node);
 	void _warning_changed(Node *p_node);
 	void _warning_changed(Node *p_node);
-	bool _update_configuration_warnings();
 
 
 	HashMap<StringName, int> per_array_page;
 	HashMap<StringName, int> per_array_page;
 	void _page_change_request(int p_new_page, const StringName &p_array_prefix);
 	void _page_change_request(int p_new_page, const StringName &p_array_prefix);