Merge pull request #82045 from marzecdawid/don't-move-not-selected-cursor-item-in-filesystem-dock

While dragging files don't move not selected cursor item in filesystem-dock
This commit is contained in:
Rémi Verschelde 2023-09-26 08:22:36 +02:00
commit bf5318f45e
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1970,15 +1970,15 @@ Vector<String> FileSystemDock::_tree_get_selected(bool remove_self_inclusion) co
Vector<String> selected_strings;
TreeItem *favorites_item = tree->get_root()->get_first_child();
TreeItem *active_selected = tree->get_selected();
if (active_selected && active_selected != favorites_item) {
selected_strings.push_back(active_selected->get_metadata(0));
TreeItem *cursor_item = tree->get_selected();
if (cursor_item && cursor_item->is_selected(0) && cursor_item != favorites_item) {
selected_strings.push_back(cursor_item->get_metadata(0));
}
TreeItem *selected = tree->get_root();
selected = tree->get_next_selected(selected);
while (selected) {
if (selected != active_selected && selected != favorites_item) {
if (selected != cursor_item && selected != favorites_item) {
selected_strings.push_back(selected->get_metadata(0));
}
selected = tree->get_next_selected(selected);