summaryrefslogtreecommitdiffstats
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 9e11ffa242..91528d90aa 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -388,7 +388,7 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo
const Color default_folder_color = get_theme_color(SNAME("folder_icon_color"), SNAME("FileDialog"));
for (int i = 0; i < favorite_paths.size(); i++) {
- String favorite = favorite_paths[i];
+ const String &favorite = favorite_paths[i];
if (!favorite.begins_with("res://")) {
continue;
}
@@ -2295,7 +2295,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
// Instantiate all selected scenes.
Vector<String> paths;
for (int i = 0; i < p_selected.size(); i++) {
- String fpath = p_selected[i];
+ const String &fpath = p_selected[i];
if (EditorFileSystem::get_singleton()->get_file_type(fpath) == "PackedScene") {
paths.push_back(fpath);
}
@@ -2333,7 +2333,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
case FILE_DEPENDENCIES: {
// Checkout the file dependencies.
if (!p_selected.is_empty()) {
- String fpath = p_selected[0];
+ const String &fpath = p_selected[0];
deps_editor->edit(fpath);
}
} break;
@@ -2341,7 +2341,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
case FILE_OWNERS: {
// Checkout the file owners.
if (!p_selected.is_empty()) {
- String fpath = p_selected[0];
+ const String &fpath = p_selected[0];
owners_editor->show(fpath);
}
} break;
@@ -2351,7 +2351,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
to_move.clear();
Vector<String> collapsed_paths = _remove_self_included_paths(p_selected);
for (int i = collapsed_paths.size() - 1; i >= 0; i--) {
- String fpath = collapsed_paths[i];
+ const String &fpath = collapsed_paths[i];
if (fpath != "res://") {
to_move.push_back(FileOrFolder(fpath, !fpath.ends_with("/")));
}
@@ -2399,7 +2399,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
Vector<String> collapsed_paths = _remove_self_included_paths(p_selected);
for (int i = 0; i < collapsed_paths.size(); i++) {
- String fpath = collapsed_paths[i];
+ const String &fpath = collapsed_paths[i];
if (fpath != "res://") {
if (fpath.ends_with("/")) {
remove_folders.push_back(fpath);
@@ -2471,7 +2471,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
case FILE_COPY_PATH: {
if (!p_selected.is_empty()) {
- String fpath = p_selected[0];
+ const String &fpath = p_selected[0];
DisplayServer::get_singleton()->clipboard_set(fpath);
}
} break;
@@ -2991,7 +2991,7 @@ void FileSystemDock::_folder_color_index_pressed(int p_index, PopupMenu *p_menu)
// Update project settings with new folder colors.
for (int i = 0; i < selected.size(); i++) {
- String fpath = selected[i];
+ const String &fpath = selected[i];
if (chosen_color_name) {
assigned_folder_colors[fpath] = chosen_color_name;
@@ -3022,7 +3022,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str
bool all_not_favorites = true;
for (int i = 0; i < p_paths.size(); i++) {
- String fpath = p_paths[i];
+ const String &fpath = p_paths[i];
if (fpath.ends_with("/")) {
foldernames.push_back(fpath);
all_files = false;
@@ -3180,7 +3180,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str
}
if (p_paths.size() == 1) {
- const String fpath = p_paths[0];
+ const String &fpath = p_paths[0];
#if !defined(ANDROID_ENABLED) && !defined(WEB_ENABLED)
p_popup->add_separator();
@@ -3565,7 +3565,7 @@ void FileSystemDock::_update_import_dock() {
Vector<String> imports;
String import_type;
for (int i = 0; i < efiles.size(); i++) {
- String fpath = efiles[i];
+ const String &fpath = efiles[i];
Ref<ConfigFile> cf;
cf.instantiate();
Error err = cf->load(fpath + ".import");