diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index 1c57bfdf3d..9feca5c673 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -378,7 +378,7 @@ Error DirAccess::_copy_dir(DirAccess *p_target_da, String p_to, int p_chmod_flag list_dir_end(); return ERR_BUG; } - Error err = copy(get_current_dir() + "/" + n, p_to + rel_path, p_chmod_flags); + Error err = copy(get_current_dir().plus_file(n), p_to + rel_path, p_chmod_flags); if (err) { list_dir_end(); return err; diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 950979a78e..251bab5783 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -313,7 +313,7 @@ Error DirAccessUnix::change_dir(String p_dir) { // try_dir is the directory we are trying to change into String try_dir = ""; if (p_dir.is_rel_path()) { - String next_dir = current_dir + "/" + p_dir; + String next_dir = current_dir.plus_file(p_dir); next_dir = next_dir.simplify_path(); try_dir = next_dir; } else { diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp index 4bc9dff26c..57c00e1bef 100644 --- a/editor/collada/collada.cpp +++ b/editor/collada/collada.cpp @@ -308,7 +308,7 @@ void Collada::_parse_image(XMLParser &parser) { String path = parser.get_attribute_value("source").strip_edges(); if (path.find("://") == -1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - image.path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir() + "/" + path.percent_decode()); + image.path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir().plus_file(path.percent_decode())); } } else { @@ -325,7 +325,7 @@ void Collada::_parse_image(XMLParser &parser) { if (path.find("://") == -1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir() + "/" + path); + path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir().plus_file(path)); } else if (path.find("file:///") == 0) { path = path.replace_first("file:///", ""); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 3c7c6ec9ed..87a37acac6 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -96,7 +96,7 @@ String EditorFileSystemDirectory::get_path() const { String p; const EditorFileSystemDirectory *d = this; while (d->parent) { - p = d->name + "/" + p; + p = d->name.plus_file(p); d = d->parent; } @@ -108,7 +108,7 @@ String EditorFileSystemDirectory::get_file_path(int p_idx) const { String file = get_file(p_idx); const EditorFileSystemDirectory *d = this; while (d->parent) { - file = d->name + "/" + file; + file = d->name.plus_file(file); d = d->parent; } diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index ff50940842..d1f765a312 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1334,7 +1334,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { end = bbcode.length(); String image = bbcode.substr(brk_end + 1, end - brk_end - 1); - Ref texture = ResourceLoader::load(base_path + "/" + image, "Texture"); + Ref texture = ResourceLoader::load(base_path.plus_file(image), "Texture"); if (texture.is_valid()) p_rt->add_image(texture); @@ -1390,7 +1390,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { String fnt = tag.substr(5, tag.length()); - Ref font = ResourceLoader::load(base_path + "/" + fnt, "Font"); + Ref font = ResourceLoader::load(base_path.plus_file(fnt), "Font"); if (font.is_valid()) p_rt->push_font(font); else { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 83d820ff0e..865ffd1baa 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2818,7 +2818,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled, Ref cf; cf.instance(); - String addon_path = "res://addons/" + p_addon + "/plugin.cfg"; + String addon_path = String("res://addons").plus_file(p_addon).plus_file("plugin.cfg"); if (!DirAccess::exists(addon_path.get_base_dir())) { ProjectSettings *ps = ProjectSettings::get_singleton(); PoolStringArray enabled_plugins = ps->get("editor_plugins/enabled"); @@ -2845,7 +2845,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled, } String path = cf->get_value("plugin", "script"); - path = "res://addons/" + p_addon + "/" + path; + path = String("res://addons").plus_file(p_addon).plus_file(path); Ref