<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Rafael Fernández López</b> <<a href="mailto:ereslibre@gmail.com">ereslibre@gmail.com</a>><br>Date: 20-jul-2007 16:39
<br>Subject: Re: Make Dolphin's SortFilterProxyModel for KDirModel public<br>To: Nick Shaforostoff <<a href="mailto:shafff@ukr.net">shafff@ukr.net</a>><br><br></span>2007/7/20, Nick Shaforostoff <<a href="mailto:shafff@ukr.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
shafff@ukr.net</a>>:<div><span class="q"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> So, this method is ESSENTIAL on the categorized view. We could either do<br>> this or add another method that sets a QSortFilterProxyModel for the<br>> categorized view apart from the model itself. The main reason is that the
<br>> lessThanGeneralPurpose method will do a "basic" sorting, just for finding<br>> out categories, and their order. Then over those elements DISORDERED on<br>> categories, the lessThan method will be applied for each category. That is
<br>> because we can't just apply the same sorting for those two different tasks.<br><br>Thanks, I'll put this explanation into dolphinsortfilterproxymodel.h for future contributors</blockquote><br></span>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.
<br><br>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.
<br><br>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.<span class="q"><br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

So, in dolphin, view first calls lessThanGeneralPurpose(), then usual lessThan() is called.<br>And if we dont have categories (eg in filedialog) then we just use lessThan(). right?<br><br>If so, then i propose to change the name of lessThanGeneralPurpose() to
<br>lessThanMetaPurpose() or lessThanPresort() or lessThanDivideIntoCategories() to avoid confusion</blockquote></span><div><br>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.
<br></div></div><div><span class="e" id="q_113e4116cf3c853e_5"><br><br>Bye and thanks,<br>Rafael Fernández López.
</span></div><br clear="all"><br>-- <br>Bye,<br>Rafael Fernández López.