[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Comparing KFileItems
From: Aurélien_Gâteau <agateau () kde ! org>
Date: 2012-10-22 12:48:33
Message-ID: 5042844.FWIa5oQnYZ () trinity
[Download RAW message or body]
Le dimanche 21 octobre 2012 13:49:49 David Faure a écrit :
> I don't think we want to call a full cmp().
>
> If you have two KFileItems referring to the same file, but one KFileItem has
> more details than the other (e.g. because it comes from KIO while the other
> one was created from a URL only), then cmp() will say false, but they are
> still about the same item.
>
> In other words:
> * operator== is for QSet/QHash, should return true "if this is about the
> same item".
> * cmp() is full comparison of all details, useful in KDirLister after an
> update (re-listing a directory), to find out if any detail has changed.
That is very interesting, I was not aware of those subtleties. I think it
would make a lot of sense to add what you wrote to KFileItem documentation.
The current cmp() doc explains a bit about the d-pointer difference with
operator==, but having usage guidelines like "operator== is for..., cmp() is
for..." would be great.
Aurélien
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic