Make Dolphin's SortFilterProxyModel for KDirModel public

Peter Penz peter.penz at gmx.at
Thu Jul 19 21:05:34 BST 2007


Hello Nick!

On Thursday 19 July 2007 20:05:30 Nick Shaforostoff wrote:
> Please review the patch. Should I commit it myself?

First thank you for trying to make the natural sorting from Dolphin available 
in kdelibs. Generally I think it's a good idea having natural sorting 
available globally.

But please don't commit this patch as it is now: It will break the sorting of 
Dolphin in combination with categorized sorting and moves too much things 
into kdelibs which should not be in there.

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.

What makes the DolphinSortFilterProxyModel as complex as it is now is mainly 
because it is possible in Dolphin having categorized sorting:
- Items are grouped by different categories (name, type, ...).
- Inside those categories a sorting is done.
- The categories themselves also get sorted.

I'd guess 70 % of the code in DolphinSortFilterProxyModel is because of the 
group by categories feature...

So from my point of view KDirSortFilterProxyModel should:
- Only use the enums provided by KDirModel (there is no need moving Dolphin 
enums into kdelibs).
- Should just overwrite the method lessThan() like done in revision 631058 and 
use the method naturalCompare() internally.
- Should not have any Nepomuk dependency (it's not clear yet whether we really 
use the Nepomuk tags for sorting in KDE 4.0, as the performance is too slow 
currently).

As Holger pointed out the license must be changed from GPL to LGPL (or at 
least a more liberal license), so each contributor for this class must give 
his OK. For sure from my point of view you have the OK, but I've done very 
less work on the DolphinSortFilterProxyModel. The main part - the 
implementation of naturalCompare() - has been done by Dominic Battre and 
Martin Pool. Rafael Fernández López implemented the categorization things, 
which may not be ported to kdelibs... Should I check with the contributors 
whether they agree to relicense the code to LGPL?

Would it be OK for you if you rebase your patch on the revision 631058 from 
DolphinSortFilterProxyModel?

Also from my point of view it would be important if core kde developers would 
give their opinion on this topic (<hint>David?</hint> ;-) ). 

Thanks and best regards,
Peter




More information about the kde-core-devel mailing list