Skip to content

Commit

Permalink
Merge pull request #78914 from KoBeWi/lazy_drop
Browse files Browse the repository at this point in the history
Fix dropping files from res:// to res://
  • Loading branch information
akien-mga committed Jul 7, 2023
2 parents 963cf54 + 1d970cd commit 64d451d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2617,8 +2617,10 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data,
if (!to_dir.is_empty()) {
Vector<String> fnames = drag_data["files"];
to_move.clear();
String target_dir = to_dir == "res://" ? to_dir : to_dir.trim_suffix("/");

for (int i = 0; i < fnames.size(); i++) {
if (fnames[i].trim_suffix("/").get_base_dir() != to_dir.trim_suffix("/")) {
if (fnames[i].trim_suffix("/").get_base_dir() != target_dir) {
to_move.push_back(FileOrFolder(fnames[i], !fnames[i].ends_with("/")));
}
}
Expand Down

0 comments on commit 64d451d

Please sign in to comment.