Make Dolphin's SortFilterProxyModel for KDirModel public

Nick Shaforostoff shafff at ukr.net
Thu Jul 19 21:59:50 BST 2007


> It will break the sorting of Dolphin in combination with categorized sorting 
why? new DolphinSortFilterProxyModel (based on KDirSortFilterProxyModel) still has
ratingForIndex(), tagsForIndex(), lessThanGeneralPurpose() and lessThanCategoryPurpose() functions.
also, its lessThan() reimplemetation checks for sortRole()==DolphinView::SortByTags||DolphinView::SortByRating.

> and moves too much things  into kdelibs which should not be in there.
did you notice commenting #if directives?
without them kdirsortfilterproxymodel.cpp is <300 lines of code

>The core functionality for natural sorting is inside 
>DolphinSortFilterProxyModel::naturalCompare(). All which has to be done for 
>making natural sorting available for KDirModel is to overwrite the method 
>lessThan() which should use naturalCompare(). In the history of 
>DolphinSortFilterProxyModel you can find a reference at revision 631058.
thanks, i knew it when i was preparing the patch

>I'd guess 70 % of the code in DolphinSortFilterProxyModel is because of the 
>group by categories feature...
from what i see it is 50%

>So from my point of view KDirSortFilterProxyModel should:
>- Only use the enums provided by KDirModel (there is no need moving Dolphin 
>enums into kdelibs).
done :))

>- Should just overwrite the method lessThan() like done in revision 631058 and 
>use the method naturalCompare() internally.
essentially - already in the patch...

>- Should not have any Nepomuk dependency
it doesnt. furthermore i've removed #if 0-like directives to avoid confusion in the future.

>Should I check with the contributors 
>whether they agree to relicense the code to LGPL?
yes, please!

>Would it be OK for you if you rebase your patch on the revision 631058 from 
>DolphinSortFilterProxyModel?
still dont see the reason for that as i have clearly separated general KDir code from nepomuk stuff.

and besides, you can optimise the code anytime you whant, as such changes aint related to API/ABI.




More information about the kde-core-devel mailing list