summaryrefslogtreecommitdiff
path: root/editor/editor_file_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r--editor/editor_file_system.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 4ddb28b440..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;
}
@@ -1290,13 +1290,7 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector
r_file_pos = cpos;
*r_d = fs;
- if (cpos != -1) {
-
- return true;
- } else {
-
- return false;
- }
+ return cpos != -1;
}
String EditorFileSystem::get_file_type(const String &p_file) const {
@@ -1604,7 +1598,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
//all went well, overwrite config files with proper remaps and md5s
for (Map<String, Map<StringName, Variant> >::Element *E = source_file_options.front(); E; E = E->next()) {
- String file = E->key();
+ const String &file = E->key();
String base_path = ResourceFormatImporter::get_singleton()->get_import_base_path(file);
FileAccessRef f = FileAccess::open(file + ".import", FileAccess::WRITE);
ERR_FAIL_COND_V(!f, ERR_FILE_CANT_OPEN);
@@ -1939,7 +1933,7 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
if (err) {
memdelete(da);
ERR_EXPLAIN("Failed to create 'res://.import' folder.");
- ERR_FAIL_COND(err != OK);
+ ERR_FAIL();
}
}
memdelete(da);