Review Request 108356: Bug 290736 - Wrong current item after deleting files

Emmanuel Pescosta emmanuelpescosta099 at gmail.com
Sat Jan 12 19:48:03 GMT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108356/
-----------------------------------------------------------

(Updated Jan. 12, 2013, 7:48 p.m.)


Review request for Dolphin and Frank Reininghaus.


Changes
-------

This patch should also fix Bug 305619


Description
-------

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 ;)


This addresses bugs 290736 and 305619.
    http://bugs.kde.org/show_bug.cgi?id=290736
    http://bugs.kde.org/show_bug.cgi?id=305619


Diffs
-----

  dolphin/src/kitemviews/kitemlistselectionmanager.h 43d0dcb 
  dolphin/src/kitemviews/kitemlistselectionmanager.cpp 383914d 

Diff: http://git.reviewboard.kde.org/r/108356/diff/


Testing
-------

Yep. Works fine so far in Dolphin

But the SelectionManager test failed -> Maybe because I implemented the behavior of Dolphin a little bit different


Thanks,

Emmanuel Pescosta

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20130112/1ded5272/attachment.htm>


More information about the kfm-devel mailing list