diff options
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r-- | editor/filesystem_dock.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 0ad7b25e4a..04036f410a 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -828,7 +828,12 @@ void FileSystemDock::_move_operation(const String &p_to_path) { //make list of remaps Map<String, String> renames; String repfrom = path == "res://" ? path : String(path + "/"); - String repto = p_to_path == "res://" ? p_to_path : String(p_to_path + "/"); + String repto = p_to_path; + if (!repto.ends_with("/")) { + repto += "/"; + } + + print_line("reprfrom: " + repfrom + " repto " + repto); for (int i = 0; i < move_files.size(); i++) { renames[move_files[i]] = move_files[i].replace_first(repfrom, repto); @@ -868,6 +873,13 @@ void FileSystemDock::_move_operation(const String &p_to_path) { if (err != OK) { EditorNode::get_singleton()->add_io_error(TTR("Error moving file:\n") + move_files[i] + "\n"); } + if (FileAccess::exists(move_files[i] + ".import")) { //move imported files too + //@todo should remove the files in .import folder + err = da->rename(move_files[i] + ".import", to + ".import"); + if (err != OK) { + EditorNode::get_singleton()->add_io_error(TTR("Error moving file:\n") + move_files[i] + ".import\n"); + } + } } for (int i = 0; i < move_dirs.size(); i++) { |