Review Request 111195: Make use of the "resort all items timer" in KFileItemModel::slotRefreshItems

Frank Reininghaus frank78ac at googlemail.com
Sun Jun 23 19:07:34 BST 2013


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


Thanks Emmanuel for the patch!

In principle you're right that many updates could cause (too) many resortings, and your patch would fix this problem.

However, it has the side effect that there will always be a 0.5 second delay between any change of a file and the resorting. This can be a bit irritating, like when you rename a file, and it takes some time until it is moved to the new position.

So to fix the problem properly, a solution like the "changes items timer" in KFileItemModelRolesUpdater would be better (i.e., do the first resorting immediately, but if there are many changes in a row, wait until all updates are done). But then I'm not sure how often such a situation will really happen and how urgent is is that we fix that. The "too many resortings" issue will only appear if the sort role is changed for many files at different times. I think that this is rather unrealistic for the "Name" and the "Size", maybe it could happen for the "Date"?

Note that the reason why "m_resortAllItemsTimer->start();" is used in KFileItemModel::setData() is that this function can indeed be called many times in a row by KFileItemModelRolesUpdater if it resolves the sort role (like the number of items in a folder or a Nepomuk role) asynchronously. In that case, we really have to avoid that every call of setData triggers a new resorting.

- Frank Reininghaus


On June 23, 2013, 1:09 p.m., Emmanuel Pescosta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111195/
> -----------------------------------------------------------
> 
> (Updated June 23, 2013, 1:09 p.m.)
> 
> 
> Review request for Dolphin.
> 
> 
> Description
> -------
> 
> Followup to patch 111146
> 
> Make use of the "resort all items timer" in KFileItemModel::slotRefreshItems 
> to avoid too much expensive resorting calls, in case of many refresh items signals.
> 
> CCBUG: 303873
> CCBUG: 299565
> 
> 
> Diffs
> -----
> 
>   dolphin/src/kitemviews/kfileitemmodel.cpp 7ea5e80 
> 
> Diff: http://git.reviewboard.kde.org/r/111195/diff/
> 
> 
> Testing
> -------
> 
> Works!
> 
> 
> Thanks,
> 
> Emmanuel Pescosta
> 
>

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


More information about the kfm-devel mailing list