summaryrefslogtreecommitdiffstats
path: root/editor/editor_vcs_interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_vcs_interface.cpp')
-rw-r--r--editor/editor_vcs_interface.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/editor/editor_vcs_interface.cpp b/editor/editor_vcs_interface.cpp
index 1f76c94655..7d39dc8715 100644
--- a/editor/editor_vcs_interface.cpp
+++ b/editor/editor_vcs_interface.cpp
@@ -34,18 +34,18 @@
EditorVCSInterface *EditorVCSInterface::singleton = nullptr;
-void EditorVCSInterface::popup_error(String p_msg) {
+void EditorVCSInterface::popup_error(const String &p_msg) {
// TRANSLATORS: %s refers to the name of a version control system (e.g. "Git").
EditorNode::get_singleton()->show_warning(p_msg.strip_edges(), vformat(TTR("%s Error"), get_vcs_name()));
}
-bool EditorVCSInterface::initialize(String p_project_path) {
+bool EditorVCSInterface::initialize(const String &p_project_path) {
bool result = false;
GDVIRTUAL_REQUIRED_CALL(_initialize, p_project_path, result);
return result;
}
-void EditorVCSInterface::set_credentials(String p_username, String p_password, String p_ssh_public_key, String p_ssh_private_key, String p_ssh_passphrase) {
+void EditorVCSInterface::set_credentials(const String &p_username, const String &p_password, const String &p_ssh_public_key, const String &p_ssh_private_key, const String &p_ssh_passphrase) {
GDVIRTUAL_REQUIRED_CALL(_set_credentials, p_username, p_password, p_ssh_public_key, p_ssh_private_key, p_ssh_passphrase);
}
@@ -75,23 +75,23 @@ List<EditorVCSInterface::StatusFile> EditorVCSInterface::get_modified_files_data
return status_files;
}
-void EditorVCSInterface::stage_file(String p_file_path) {
+void EditorVCSInterface::stage_file(const String &p_file_path) {
GDVIRTUAL_REQUIRED_CALL(_stage_file, p_file_path);
}
-void EditorVCSInterface::unstage_file(String p_file_path) {
+void EditorVCSInterface::unstage_file(const String &p_file_path) {
GDVIRTUAL_REQUIRED_CALL(_unstage_file, p_file_path);
}
-void EditorVCSInterface::discard_file(String p_file_path) {
+void EditorVCSInterface::discard_file(const String &p_file_path) {
GDVIRTUAL_REQUIRED_CALL(_discard_file, p_file_path);
}
-void EditorVCSInterface::commit(String p_msg) {
+void EditorVCSInterface::commit(const String &p_msg) {
GDVIRTUAL_REQUIRED_CALL(_commit, p_msg);
}
-List<EditorVCSInterface::DiffFile> EditorVCSInterface::get_diff(String p_identifier, TreeArea p_area) {
+List<EditorVCSInterface::DiffFile> EditorVCSInterface::get_diff(const String &p_identifier, TreeArea p_area) {
TypedArray<Dictionary> result;
if (!GDVIRTUAL_REQUIRED_CALL(_get_diff, p_identifier, int(p_area), result)) {
return {};
@@ -130,19 +130,19 @@ List<String> EditorVCSInterface::get_branch_list() {
return branch_list;
}
-void EditorVCSInterface::create_branch(String p_branch_name) {
+void EditorVCSInterface::create_branch(const String &p_branch_name) {
GDVIRTUAL_REQUIRED_CALL(_create_branch, p_branch_name);
}
-void EditorVCSInterface::create_remote(String p_remote_name, String p_remote_url) {
+void EditorVCSInterface::create_remote(const String &p_remote_name, const String &p_remote_url) {
GDVIRTUAL_REQUIRED_CALL(_create_remote, p_remote_name, p_remote_url);
}
-void EditorVCSInterface::remove_branch(String p_branch_name) {
+void EditorVCSInterface::remove_branch(const String &p_branch_name) {
GDVIRTUAL_REQUIRED_CALL(_remove_branch, p_branch_name);
}
-void EditorVCSInterface::remove_remote(String p_remote_name) {
+void EditorVCSInterface::remove_remote(const String &p_remote_name) {
GDVIRTUAL_REQUIRED_CALL(_remove_remote, p_remote_name);
}
@@ -152,25 +152,25 @@ String EditorVCSInterface::get_current_branch_name() {
return result;
}
-bool EditorVCSInterface::checkout_branch(String p_branch_name) {
+bool EditorVCSInterface::checkout_branch(const String &p_branch_name) {
bool result = false;
GDVIRTUAL_REQUIRED_CALL(_checkout_branch, p_branch_name, result);
return result;
}
-void EditorVCSInterface::pull(String p_remote) {
+void EditorVCSInterface::pull(const String &p_remote) {
GDVIRTUAL_REQUIRED_CALL(_pull, p_remote);
}
-void EditorVCSInterface::push(String p_remote, bool p_force) {
+void EditorVCSInterface::push(const String &p_remote, bool p_force) {
GDVIRTUAL_REQUIRED_CALL(_push, p_remote, p_force);
}
-void EditorVCSInterface::fetch(String p_remote) {
+void EditorVCSInterface::fetch(const String &p_remote) {
GDVIRTUAL_REQUIRED_CALL(_fetch, p_remote);
}
-List<EditorVCSInterface::DiffHunk> EditorVCSInterface::get_line_diff(String p_file_path, String p_text) {
+List<EditorVCSInterface::DiffHunk> EditorVCSInterface::get_line_diff(const String &p_file_path, const String &p_text) {
TypedArray<Dictionary> result;
if (!GDVIRTUAL_REQUIRED_CALL(_get_line_diff, p_file_path, p_text, result)) {
return {};
@@ -195,7 +195,7 @@ String EditorVCSInterface::get_vcs_name() {
return result;
}
-Dictionary EditorVCSInterface::create_diff_line(int p_new_line_no, int p_old_line_no, String p_content, String p_status) {
+Dictionary EditorVCSInterface::create_diff_line(int p_new_line_no, int p_old_line_no, const String &p_content, const String &p_status) {
Dictionary diff_line;
diff_line["new_line_no"] = p_new_line_no;
diff_line["old_line_no"] = p_old_line_no;
@@ -220,7 +220,7 @@ Dictionary EditorVCSInterface::add_line_diffs_into_diff_hunk(Dictionary p_diff_h
return p_diff_hunk;
}
-Dictionary EditorVCSInterface::create_diff_file(String p_new_file, String p_old_file) {
+Dictionary EditorVCSInterface::create_diff_file(const String &p_new_file, const String &p_old_file) {
Dictionary file_diff;
file_diff["new_file"] = p_new_file;
file_diff["old_file"] = p_old_file;
@@ -228,7 +228,7 @@ Dictionary EditorVCSInterface::create_diff_file(String p_new_file, String p_old_
return file_diff;
}
-Dictionary EditorVCSInterface::create_commit(String p_msg, String p_author, String p_id, int64_t p_unix_timestamp, int64_t p_offset_minutes) {
+Dictionary EditorVCSInterface::create_commit(const String &p_msg, const String &p_author, const String &p_id, int64_t p_unix_timestamp, int64_t p_offset_minutes) {
Dictionary commit_info;
commit_info["message"] = p_msg;
commit_info["author"] = p_author;
@@ -243,7 +243,7 @@ Dictionary EditorVCSInterface::add_diff_hunks_into_diff_file(Dictionary p_diff_f
return p_diff_file;
}
-Dictionary EditorVCSInterface::create_status_file(String p_file_path, ChangeType p_change, TreeArea p_area) {
+Dictionary EditorVCSInterface::create_status_file(const String &p_file_path, ChangeType p_change, TreeArea p_area) {
Dictionary sf;
sf["file_path"] = p_file_path;
sf["change_type"] = p_change;
@@ -251,7 +251,7 @@ Dictionary EditorVCSInterface::create_status_file(String p_file_path, ChangeType
return sf;
}
-EditorVCSInterface::DiffLine EditorVCSInterface::_convert_diff_line(Dictionary p_diff_line) {
+EditorVCSInterface::DiffLine EditorVCSInterface::_convert_diff_line(const Dictionary &p_diff_line) {
DiffLine d;
d.new_line_no = p_diff_line["new_line_no"];
d.old_line_no = p_diff_line["old_line_no"];
@@ -260,7 +260,7 @@ EditorVCSInterface::DiffLine EditorVCSInterface::_convert_diff_line(Dictionary p
return d;
}
-EditorVCSInterface::DiffHunk EditorVCSInterface::_convert_diff_hunk(Dictionary p_diff_hunk) {
+EditorVCSInterface::DiffHunk EditorVCSInterface::_convert_diff_hunk(const Dictionary &p_diff_hunk) {
DiffHunk dh;
dh.new_lines = p_diff_hunk["new_lines"];
dh.old_lines = p_diff_hunk["old_lines"];
@@ -274,7 +274,7 @@ EditorVCSInterface::DiffHunk EditorVCSInterface::_convert_diff_hunk(Dictionary p
return dh;
}
-EditorVCSInterface::DiffFile EditorVCSInterface::_convert_diff_file(Dictionary p_diff_file) {
+EditorVCSInterface::DiffFile EditorVCSInterface::_convert_diff_file(const Dictionary &p_diff_file) {
DiffFile df;
df.new_file = p_diff_file["new_file"];
df.old_file = p_diff_file["old_file"];
@@ -286,7 +286,7 @@ EditorVCSInterface::DiffFile EditorVCSInterface::_convert_diff_file(Dictionary p
return df;
}
-EditorVCSInterface::Commit EditorVCSInterface::_convert_commit(Dictionary p_commit) {
+EditorVCSInterface::Commit EditorVCSInterface::_convert_commit(const Dictionary &p_commit) {
EditorVCSInterface::Commit c;
c.msg = p_commit["message"];
c.author = p_commit["author"];
@@ -296,7 +296,7 @@ EditorVCSInterface::Commit EditorVCSInterface::_convert_commit(Dictionary p_comm
return c;
}
-EditorVCSInterface::StatusFile EditorVCSInterface::_convert_status_file(Dictionary p_status_file) {
+EditorVCSInterface::StatusFile EditorVCSInterface::_convert_status_file(const Dictionary &p_status_file) {
StatusFile sf;
sf.file_path = p_status_file["file_path"];
sf.change_type = (ChangeType)(int)p_status_file["change_type"];