1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

VCS: Replace usage of varray() by using callable_mp::bind()

This commit is contained in:
Twarit Waikar
2022-08-01 00:31:24 +05:30
parent c698e4f5f9
commit 1bb5e65798

View File

@@ -1109,7 +1109,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
Button *select_public_path_button = memnew(Button);
select_public_path_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Folder", "EditorIcons"));
select_public_path_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_popup_ssh_key_file_dialog), varray(set_up_ssh_public_key_file_dialog));
select_public_path_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_popup_ssh_key_file_dialog).bind(set_up_ssh_public_key_file_dialog));
select_public_path_button->set_tooltip(TTR("Select SSH public key path"));
set_up_ssh_public_key_input_hbc->add_child(select_public_path_button);
@@ -1143,7 +1143,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
Button *select_private_path_button = memnew(Button);
select_private_path_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Folder", "EditorIcons"));
select_private_path_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_popup_ssh_key_file_dialog), varray(set_up_ssh_private_key_file_dialog));
select_private_path_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_popup_ssh_key_file_dialog).bind(set_up_ssh_private_key_file_dialog));
select_private_path_button->set_tooltip(TTR("Select SSH private key path"));
set_up_ssh_private_key_input_hbc->add_child(select_private_path_button);
@@ -1211,8 +1211,8 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
unstaged_files->set_h_size_flags(Tree::SIZE_EXPAND_FILL);
unstaged_files->set_v_size_flags(Tree::SIZE_EXPAND_FILL);
unstaged_files->set_select_mode(Tree::SELECT_ROW);
unstaged_files->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff), varray(unstaged_files));
unstaged_files->connect(SNAME("item_activated"), callable_mp(this, &VersionControlEditorPlugin::_item_activated), varray(unstaged_files));
unstaged_files->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(unstaged_files));
unstaged_files->connect(SNAME("item_activated"), callable_mp(this, &VersionControlEditorPlugin::_item_activated).bind(unstaged_files));
unstaged_files->connect(SNAME("button_clicked"), callable_mp(this, &VersionControlEditorPlugin::_cell_button_pressed));
unstaged_files->create_item();
unstaged_files->set_hide_root(true);
@@ -1241,16 +1241,16 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
staged_files->set_h_size_flags(Tree::SIZE_EXPAND_FILL);
staged_files->set_v_size_flags(Tree::SIZE_EXPAND_FILL);
staged_files->set_select_mode(Tree::SELECT_ROW);
staged_files->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff), varray(staged_files));
staged_files->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(staged_files));
staged_files->connect(SNAME("button_clicked"), callable_mp(this, &VersionControlEditorPlugin::_cell_button_pressed));
staged_files->connect(SNAME("item_activated"), callable_mp(this, &VersionControlEditorPlugin::_item_activated), varray(staged_files));
staged_files->connect(SNAME("item_activated"), callable_mp(this, &VersionControlEditorPlugin::_item_activated).bind(staged_files));
staged_files->create_item();
staged_files->set_hide_root(true);
stage_area->add_child(staged_files);
// Editor crashes if bind is null
unstage_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_move_all), varray(staged_files));
stage_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_move_all), varray(unstaged_files));
unstage_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_move_all).bind(staged_files));
stage_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_move_all).bind(unstaged_files));
version_commit_dock->add_child(memnew(HSeparator));
@@ -1311,7 +1311,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
commit_list->set_columns(2); // Commit msg, author
commit_list->set_column_custom_minimum_width(0, 40);
commit_list->set_column_custom_minimum_width(1, 20);
commit_list->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff), varray(commit_list));
commit_list->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(commit_list));
version_commit_dock->add_child(commit_list);
version_commit_dock->add_child(memnew(HSeparator));