Fix dropping files from res:// to res://

(cherry picked from commit 1d970cd6ca)
This commit is contained in:
kobewi 2023-07-01 19:21:35 +02:00 committed by Yuri Sizov
parent 836913ce7a
commit 705c1d6bdf
1 changed files with 3 additions and 1 deletions

View File

@ -2617,8 +2617,10 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data,
if (!to_dir.is_empty()) { if (!to_dir.is_empty()) {
Vector<String> fnames = drag_data["files"]; Vector<String> fnames = drag_data["files"];
to_move.clear(); to_move.clear();
String target_dir = to_dir == "res://" ? to_dir : to_dir.trim_suffix("/");
for (int i = 0; i < fnames.size(); i++) { 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("/"))); to_move.push_back(FileOrFolder(fnames[i], !fnames[i].ends_with("/")));
} }
} }