diff --git a/core/object/object.cpp b/core/object/object.cpp index a642647853b..37643161227 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -1266,10 +1266,6 @@ void Object::get_signals_connected_to_this(List *p_connections) cons } } -Error Object::connect_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, const Vector &p_binds, uint32_t p_flags) { - return connect(p_signal, Callable(p_to_object, p_to_method), p_binds, p_flags); -} - Error Object::connect(const StringName &p_signal, const Callable &p_callable, const Vector &p_binds, uint32_t p_flags) { ERR_FAIL_COND_V(p_callable.is_null(), ERR_INVALID_PARAMETER); @@ -1331,10 +1327,6 @@ Error Object::connect(const StringName &p_signal, const Callable &p_callable, co return OK; } -bool Object::is_connected_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method) const { - return is_connected(p_signal, Callable(p_to_object, p_to_method)); -} - bool Object::is_connected(const StringName &p_signal, const Callable &p_callable) const { ERR_FAIL_COND_V(p_callable.is_null(), false); const SignalData *s = signal_map.getptr(p_signal); @@ -1358,10 +1350,6 @@ bool Object::is_connected(const StringName &p_signal, const Callable &p_callable //return (E!=nullptr ); } -void Object::disconnect_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method) { - _disconnect(p_signal, Callable(p_to_object, p_to_method)); -} - void Object::disconnect(const StringName &p_signal, const Callable &p_callable) { _disconnect(p_signal, p_callable); } diff --git a/core/object/object.h b/core/object/object.h index 0bcfa42e3d8..5bf9600c5ad 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -697,10 +697,6 @@ public: int get_persistent_signal_connection_count() const; void get_signals_connected_to_this(List *p_connections) const; - Error connect_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, const Vector &p_binds = Vector(), uint32_t p_flags = 0); - void disconnect_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method); - bool is_connected_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method) const; - Error connect(const StringName &p_signal, const Callable &p_callable, const Vector &p_binds = Vector(), uint32_t p_flags = 0); void disconnect(const StringName &p_signal, const Callable &p_callable); bool is_connected(const StringName &p_signal, const Callable &p_callable) const; diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 22adf4f2671..25ff7f884ae 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -507,14 +507,14 @@ Ref AnimationBezierTrackEdit::get_animation() const { void AnimationBezierTrackEdit::set_animation_and_track(const Ref &p_animation, int p_track) { animation = p_animation; track = p_track; - if (is_connected_compat("select_key", editor, "_key_selected")) { - disconnect_compat("select_key", editor, "_key_selected"); + if (is_connected("select_key", Callable(editor, "_key_selected"))) { + disconnect("select_key", Callable(editor, "_key_selected")); } - if (is_connected_compat("deselect_key", editor, "_key_deselected")) { - disconnect_compat("deselect_key", editor, "_key_deselected"); + if (is_connected("deselect_key", Callable(editor, "_key_deselected"))) { + disconnect("deselect_key", Callable(editor, "_key_deselected")); } - connect_compat("select_key", editor, "_key_selected", varray(p_track), CONNECT_DEFERRED); - connect_compat("deselect_key", editor, "_key_deselected", varray(p_track), CONNECT_DEFERRED); + connect("select_key", Callable(editor, "_key_selected"), varray(p_track), CONNECT_DEFERRED); + connect("deselect_key", Callable(editor, "_key_deselected"), varray(p_track), CONNECT_DEFERRED); update(); } @@ -533,7 +533,7 @@ void AnimationBezierTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) { void AnimationBezierTrackEdit::set_editor(AnimationTrackEditor *p_editor) { editor = p_editor; - connect_compat("clear_selection", editor, "_clear_selection", varray(false)); + connect("clear_selection", Callable(editor, "_clear_selection"), varray(false)); } void AnimationBezierTrackEdit::_play_position_draw() { diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index f984f48c1cc..1fdba10a743 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -42,7 +42,7 @@ void EditorPluginSettings::_notification(int p_what) { if (p_what == NOTIFICATION_WM_WINDOW_FOCUS_IN) { update_plugins(); } else if (p_what == Node::NOTIFICATION_READY) { - plugin_config_dialog->connect_compat("plugin_ready", EditorNode::get_singleton(), "_on_plugin_ready"); + plugin_config_dialog->connect("plugin_ready", Callable(EditorNode::get_singleton(), "_on_plugin_ready")); plugin_list->connect("button_pressed", callable_mp(this, &EditorPluginSettings::_cell_button_pressed)); } } diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 74777b10f19..804a72bd1d2 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -6667,7 +6667,7 @@ Node3DEditorPlugin::Node3DEditorPlugin(EditorNode *p_node) { editor->get_viewport()->add_child(spatial_editor); spatial_editor->hide(); - spatial_editor->connect_compat("transform_key_request", editor->get_inspector_dock(), "_transform_keyed"); + spatial_editor->connect("transform_key_request", Callable(editor->get_inspector_dock(), "_transform_keyed")); } Node3DEditorPlugin::~Node3DEditorPlugin() { diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 3b95b1a0663..900a2c75a0e 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -3620,11 +3620,11 @@ void TileSetEditorPlugin::make_visible(bool p_visible) { if (p_visible) { tileset_editor_button->show(); editor->make_bottom_panel_item_visible(tileset_editor); - get_tree()->connect_compat("idle_frame", tileset_editor, "_on_workspace_process"); + get_tree()->connect("idle_frame", Callable(tileset_editor, "_on_workspace_process")); } else { editor->hide_bottom_panel(); tileset_editor_button->hide(); - get_tree()->disconnect_compat("idle_frame", tileset_editor, "_on_workspace_process"); + get_tree()->disconnect("idle_frame", Callable(tileset_editor, "_on_workspace_process")); } } diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 75509c75448..8435dccf4a0 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -865,10 +865,10 @@ void ProjectExportDialog::_validate_export_path(const String &p_path) { if (invalid_path) { export_project->get_ok()->set_disabled(true); - export_project->get_line_edit()->disconnect_compat("text_entered", export_project, "_file_entered"); + export_project->get_line_edit()->disconnect("text_entered", Callable(export_project, "_file_entered")); } else { export_project->get_ok()->set_disabled(false); - export_project->get_line_edit()->connect_compat("text_entered", export_project, "_file_entered"); + export_project->get_line_edit()->connect("text_entered", Callable(export_project, "_file_entered")); } } @@ -900,9 +900,9 @@ void ProjectExportDialog::_export_project() { // with _validate_export_path. // FIXME: This is a hack, we should instead change EditorFileDialog to allow // disabling validation by the "text_entered" signal. - if (!export_project->get_line_edit()->is_connected_compat("text_entered", export_project, "_file_entered")) { + if (!export_project->get_line_edit()->is_connected("text_entered", Callable(export_project, "_file_entered"))) { export_project->get_ok()->set_disabled(false); - export_project->get_line_edit()->connect_compat("text_entered", export_project, "_file_entered"); + export_project->get_line_edit()->connect("text_entered", Callable(export_project, "_file_entered")); } export_project->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index fafb90e864a..9c37ae584a0 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1073,14 +1073,14 @@ void SceneTreeDock::_notification(int p_what) { CanvasItemEditorPlugin *canvas_item_plugin = Object::cast_to(editor_data->get_editor("2D")); if (canvas_item_plugin) { - canvas_item_plugin->get_canvas_item_editor()->connect_compat("item_lock_status_changed", scene_tree, "_update_tree"); - canvas_item_plugin->get_canvas_item_editor()->connect_compat("item_group_status_changed", scene_tree, "_update_tree"); + canvas_item_plugin->get_canvas_item_editor()->connect("item_lock_status_changed", Callable(scene_tree, "_update_tree")); + canvas_item_plugin->get_canvas_item_editor()->connect("item_group_status_changed", Callable(scene_tree, "_update_tree")); scene_tree->connect("node_changed", callable_mp((CanvasItem *)canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), &CanvasItem::update)); } Node3DEditorPlugin *spatial_editor_plugin = Object::cast_to(editor_data->get_editor("3D")); - spatial_editor_plugin->get_spatial_editor()->connect_compat("item_lock_status_changed", scene_tree, "_update_tree"); - spatial_editor_plugin->get_spatial_editor()->connect_compat("item_group_status_changed", scene_tree, "_update_tree"); + spatial_editor_plugin->get_spatial_editor()->connect("item_lock_status_changed", Callable(scene_tree, "_update_tree")); + spatial_editor_plugin->get_spatial_editor()->connect("item_group_status_changed", Callable(scene_tree, "_update_tree")); button_add->set_icon(get_theme_icon("Add", "EditorIcons")); button_instance->set_icon(get_theme_icon("Instance", "EditorIcons")); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index b10d4523f22..f9ef184579f 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -2367,7 +2367,7 @@ void VisualScriptFunctionState::connect_to_signal(Object *p_obj, const String &p binds.push_back(p_binds[i]); } binds.push_back(Ref(this)); //add myself on the back to avoid dying from unreferencing - p_obj->connect_compat(p_signal, this, "_signal_callback", binds, CONNECT_ONESHOT); + p_obj->connect(p_signal, Callable(this, "_signal_callback"), binds, CONNECT_ONESHOT); } bool VisualScriptFunctionState::is_valid() const { diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index 0ae1c0e3b67..4425af26f9f 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -848,7 +848,7 @@ Ref Skeleton3D::register_skin(const Ref &p_skin) { skin_bindings.insert(skin_ref.operator->()); - skin->connect_compat("changed", skin_ref.operator->(), "_skin_changed"); + skin->connect("changed", Callable(skin_ref.operator->(), "_skin_changed")); _make_dirty(); //skin needs to be updated, so update skeleton diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 17ce05f1303..36552c966d6 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -565,7 +565,7 @@ void AnimationNodeStateMachine::replace_node(const StringName &p_name, Ref node = states[p_name].node; if (node.is_valid()) { - node->disconnect_compat("tree_changed", this, "_tree_changed"); + node->disconnect("tree_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed)); } } @@ -574,7 +574,7 @@ void AnimationNodeStateMachine::replace_node(const StringName &p_name, Refconnect_compat("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); + p_node->connect("tree_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed), varray(), CONNECT_REFERENCE_COUNTED); } Ref AnimationNodeStateMachine::get_node(const StringName &p_name) const {