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

Emmanuel Pescosta emmanuelpescosta099 at gmail.com
Mon Jun 24 09:52:39 BST 2013



> On June 23, 2013, 6:07 p.m., Frank Reininghaus wrote:
> > 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.

> 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 delay also happens when you change tags/description/... (if sort by tags/description/... is enabled). 

> I think that this is rather unrealistic for the "Name" and the "Size", maybe it could happen for the "Date"?
Date and size can change very often in download folders, build directories, ... (Esp. when you have expanded folders, because of multiple dir listers)

But if you don't like it, I'll discard this patch (was just an idea, because the code for delayed resorting is already there) ;)


- Emmanuel


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


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/20130624/5ded4044/attachment.htm>


More information about the kfm-devel mailing list