Review Request 113515: Make KFileItemModel::createMimeData() faster, and ensure that the order of the URLs in the QMimeData object is the same as the order of the items in the view

Frank Reininghaus frank78ac at googlemail.com
Wed Oct 30 23:19:12 GMT 2013


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

Review request for Dolphin.


Bugs: 283409
    http://bugs.kde.org/show_bug.cgi?id=283409


Repository: kde-baseapps


Description
-------

Note that the debugging output in DolphinView in this patch is not meant to be pushed to master, it's only there to make the effects of this patch easier to see.

Selecting many items and copying them to the clipboard can take quite a bit of time, and the URLs in the clipboard are always sorted by name in ascending order, no matter how the files are sorted in the view. This is because we use KDirModel::simplifiedUrlList(urls) to remove child items from the list of URLs, and this function sorts the URLs internally to make it easier to find out which of them are child URLs.

We can fix this quite easily now, because the selected indexes are now always stored in the view order, and this makes it easy to detect if an item is a child of the last item that has been added to the QMimeData.


Diffs
-----

  dolphin/src/kitemviews/kfileitemmodel.cpp 261b230 
  dolphin/src/views/dolphinview.cpp d0a85b3 

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


Testing
-------

The URLs in the QMimeData now appear in the same order as in the view.

For benchmarking purposes, I pressed Ctrl+A and Ctrl+C in some folders on my hard drive and measured the time required to create the mime data with the DolphinView part of this patch (which is not meant to be pushed to master):

/usr/include/ (374 items): 27 ms (master) -> 9 ms (patched)

/usr/lib64 (3375 items): 210 ms -> 88 ms

/usr/ in Details View, with /usr/bin/ (3541 items) and /usr/lib64/ expanded: 1258 ms -> 0 ms

So the savings are particularly large when expanded folders are involved, but even in the other cases, this patch saves quite a bit of time.


Thanks,

Frank Reininghaus

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


More information about the kfm-devel mailing list