summaryrefslogtreecommitdiffstats
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2023-12-14 18:18:44 +0100
committerkobewi <kobewi4e@gmail.com>2023-12-14 19:49:11 +0100
commit0ae1241304660559f42aee1293c0e18286f46b1d (patch)
treede2420e5d00faee9e602b01f9f2a9b887cadf089 /editor/filesystem_dock.cpp
parenta6c0c90058eb14bb14285ccf5eb6f99cbb8977b4 (diff)
downloadredot-engine-0ae1241304660559f42aee1293c0e18286f46b1d.tar.gz
Properly select the newly duplicated file
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 224f4c2041..1b966fced1 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -1296,6 +1296,13 @@ void FileSystemDock::_fs_changed() {
_update_file_list(true);
}
+ if (!select_after_scan.is_empty()) {
+ _navigate_to_path(select_after_scan);
+ select_after_scan.clear();
+ import_dock_needs_update = true;
+ _update_import_dock();
+ }
+
set_process(false);
}
@@ -1475,8 +1482,6 @@ void FileSystemDock::_try_duplicate_item(const FileOrFolder &p_item, const Strin
EditorNode::get_singleton()->add_io_error(TTR("Cannot move a folder into itself.") + "\n" + old_path + "\n");
return;
}
- const_cast<FileSystemDock *>(this)->current_path = new_path;
-
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
if (p_item.is_file) {
@@ -1916,6 +1921,7 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool p_cop
for (int i = 0; i < to_move.size(); i++) {
if (to_move[i].path != new_paths[i]) {
_try_duplicate_item(to_move[i], new_paths[i]);
+ select_after_scan = new_paths[i];
is_copied = true;
}
}