Bug 290736 - Wrong current item after deleting files

Review Request #108356 - Created Jan. 11, 2013 and submitted

Information
Emmanuel Pescosta
kde-baseapps
4.10
290736, 305619
Reviewers
dolphin
freininghaus
Select right item as current item (first item after the deletion) after deleting files

When the current item is one of the deleted items, then the first item after the deletion range gets selected.

Example:
* Folders: A, B, C, D, E
* Select: E, B -> B is current item (because it was the last selected item)
* Remove them -> In this example we have two deletion ranges [Range 1: B, Range 2: E]
* C is the new current item (Because it is the first item after the deletion range, in which the previous current item was placed - in this example B)

I hope this is the right behavior? ;) Or should the item, after the last deletion range, be the new current item?


Btw.: 
How can I decide if items were added or removed in void KItemListSelectionManager::itemsMoved(const KItemRange& itemRange, const QList<int>& movedToIndexes)?
If this is possible, we can replace this function by:

void KItemListSelectionManager::itemsMoved(const KItemRange& itemRange, const QList<int>& movedToIndexes)
{
    const KItemRangeList itemRanges = KItemRangeList() << itemRange;

    if (/*moved away -> deleted*/) {
        itemsRemoved(itemRanges);
    } else {
        itemsInserted(itemRanges);
    }
}

-> Save a few lines of source code + Fix Bug 305619 ;)
Yep. Works fine so far in Dolphin

But the SelectionManager test failed -> Maybe because I implemented the behavior of Dolphin a little bit different
Emmanuel Pescosta
Emmanuel Pescosta
Frank Reininghaus
Commit Hook
Emmanuel Pescosta
Review request changed

Status: Closed (submitted)

Loading...