Fwd: Make Dolphin's SortFilterProxyModel for KDirModel public

Rafael Fernández López ereslibre at gmail.com
Fri Jul 20 15:39:34 BST 2007


---------- Forwarded message ----------
From: Rafael Fernández López <ereslibre at gmail.com>
Date: 20-jul-2007 16:39
Subject: Re: Make Dolphin's SortFilterProxyModel for KDirModel public
To: Nick Shaforostoff <shafff at ukr.net>

2007/7/20, Nick Shaforostoff <shafff at ukr.net>:

> > So, this method is ESSENTIAL on the categorized view. We could either do
> > this or add another method that sets a QSortFilterProxyModel for the
> > categorized view apart from the model itself. The main reason is that
> the
> > lessThanGeneralPurpose method will do a "basic" sorting, just for
> finding
> > out categories, and their order. Then over those elements DISORDERED on
> > categories, the lessThan method will be applied for each category. That
> is
> > because we can't just apply the same sorting for those two different
> tasks.
>
> Thanks, I'll put this explanation into dolphinsortfilterproxymodel.h for
> future contributors


Yes. What I don't see is how could KCategorizedView compile without that
method. I am probably not very good with my XRAY eyes on patches without the
source code locally.

The easy explanation is that not always folders go first. That will depend.
Imagine we sort by Rating. Categories will be created by 10 stars, 9 stars,
8 stars... but a category with only a file with rating 10 will go before a
category with a folder with rating 8. That's the main reason, and that's
lessThanGeneralPurpose() method. That will go category by category creating
sets of elements. Then for each set of elements lessThanCategoryPurpose()
will be applied, because for each category we wan't first folders and bla
bla bla... That's the main reason of that method existence.

For that reason, is not that clear that we want ALWAYS folders first. On
each category, yes, that's true. But that's not true always, as I have
pointed out on the example before.

So, in dolphin, view first calls lessThanGeneralPurpose(), then usual
> lessThan() is called.
> And if we dont have categories (eg in filedialog) then we just use
> lessThan(). right?
>
> If so, then i propose to change the name of lessThanGeneralPurpose() to
> lessThanMetaPurpose() or lessThanPresort() or
> lessThanDivideIntoCategories() to avoid confusion


What is needed here is to comment the class. The name is OK I think because
is the General Purpose, and Category Purpose is for each category. The
problem is that I hadn't got time to comment KSortFilterProxyModel, and from
that point of view, I am sorry. But I really didn't think a class of this
kind was being added to kdelibs for 4.0. That's the reason of why I
committed it without commenting, because till now I was the only person
working on that part, and we talked about adding it to kdelibs probably on
4.1 when those classes were "mature". And I planned it to comment then when
coming back from vacation.


Bye and thanks,
Rafael Fernández López.


-- 
Bye,
Rafael Fernández López.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070720/a2977929/attachment.htm>


More information about the kde-core-devel mailing list