Comment 11 for bug 137409

Revision history for this message
In , Osterfeld (osterfeld) wrote :

SVN commit 495485 by osterfeld:

forward port: fix semantics of comparison operators <, <=, >, >=. Bug 114997 as seen in 3.5 should be fixed in trunk anyway,
as we use QHash there (using operator==) instead of QMap (using operator<), however, the operators should work correctly
nevertheless.
CCBUG: 114997

 M +6 -4 article.cpp

--- trunk/KDE/kdepim/akregator/src/article.cpp #495484:495485
@@ -241,22 +241,24 @@

 bool Article::operator<(const Article &other) const
 {
- return pubDate() > other.pubDate();
+ return pubDate() > other.pubDate() ||
+ (pubDate() == other.pubDate() && guid() < other.guid() );
 }

 bool Article::operator<=(const Article &other) const
 {
- return pubDate() >= other.pubDate();
+ return (pubDate() > other.pubDate() || *this == other);
 }

 bool Article::operator>(const Article &other) const
 {
- return pubDate() < other.pubDate();
+ return pubDate() < other.pubDate() ||
+ (pubDate() == other.pubDate() && guid() > other.guid() );
 }

 bool Article::operator>=(const Article &other) const
 {
- return pubDate() <= other.pubDate();
+ return (pubDate() > other.pubDate() || *this == other);
 }

 bool Article::operator==(const Article &other) const