[Kde-pim] Review Request: Fix Incidence::operator== when there are attachments
Sergio Martins
iamsergio at gmail.com
Wed Jun 10 22:37:02 BST 2009
> On 2009-06-10 14:27:34, Kevin Krammer wrote:
> > trunk/KDE/kdepimlibs/kcal/listbase.h, line 150
> > <http://reviewboard.kde.org/r/821/diff/2/?file=7083#file7083line150>
> >
> > If you also implement Attachment::operator!= (for example by calling !operator==) you could make this line a bit prettier
Then I'd have to implement operator!= in everything that uses ListBase, Incidences, Alarms, Attendees, Attachments etc.
Maybe too many changes for 4.3 (although trivial )
- Sergio
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/821/#review1295
-----------------------------------------------------------
On 2009-06-10 14:15:47, Sergio Martins wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/821/
> -----------------------------------------------------------
>
> (Updated 2009-06-10 14:15:47)
>
>
> Review request for KDE PIM.
>
>
> Summary
> -------
>
> If you have two identical incidences with attachments Incidence::operator== will return false.
>
> This happens because we are comparing two ListBase object (attachments() == i2.attachments()).
>
> ListBase holds items of class <T> but it's derived from QList<T*>, so when you compare two ListBases, QList<T*>::operator== get's called, and it compares addresses instead of values.
>
> I implemented ListBase::operator== so we compare values.
>
>
> Diffs
> -----
>
> trunk/KDE/kdepimlibs/kcal/attachment.h 979860
> trunk/KDE/kdepimlibs/kcal/attachment.cpp 979860
> trunk/KDE/kdepimlibs/kcal/listbase.h 979860
>
> Diff: http://reviewboard.kde.org/r/821/diff
>
>
> Testing
> -------
>
> Compared attachments.
>
>
> Thanks,
>
> Sergio
>
>
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list