diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-09-03 00:22:54 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-09-03 00:24:36 -0300 |
commit | ce28452109676d55e4d1fbb7158c8bf1fa8db406 (patch) | |
tree | f36f735311b6b06c3be39b821b4bdf7dfe2ac83d /editor/filesystem_dock.cpp | |
parent | 53e7f55a898efd1c1a3b424c3bce81c1240a9ca6 (diff) | |
download | redot-engine-ce28452109676d55e4d1fbb7158c8bf1fa8db406.tar.gz |
-Fixed EditorDirDialog, which was really old and needed to use EditorFileSystem
-Fixed refactoring tools to work with imported scenes (properly move .import files)
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++) { |