-rw-r--r-- | libkcal/incidencebase.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 51f2e9d..1e99082 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp @@ -85,55 +85,62 @@ bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 ) } if ( i1.attendees().count() > 0 ) { Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ; while ( a1 ) { if ( !( (*a1) == (*a2)) ) { //qDebug("Attendee not equal "); return false; } a1 = i1.attendees().next(); a2 = i2.attendees().next(); } } //if ( i1.dtStart() != i2.dtStart() ) // return false; #if 0 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() ); qDebug("1 %d ",i1.duration() == i2.duration() ); qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() ); qDebug("1 %d ",i1.pilotId() == i2.pilotId() ); qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() ); qDebug("6 %d ",i1.organizer() == i2.organizer() ); #endif + if ( i1.hasDuration() == i2.hasDuration() ) { + if ( i1.hasDuration() ) { + if ( i1.duration() != i2.duration() ) + return false; + } + } else { + return false; + } + return ( i1.organizer() == i2.organizer() && // i1.uid() == i2.uid() && // Don't compare lastModified, otherwise the operator is not // of much use. We are not comparing for identity, after all. i1.doesFloat() == i2.doesFloat() && - i1.duration() == i2.duration() && - i1.hasDuration() == i2.hasDuration() && i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() ); // no need to compare mObserver } QDateTime IncidenceBase::getEvenTime( QDateTime dt ) { QTime t = dt.time(); dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); return dt; } void IncidenceBase::setUid(const QString &uid) { mUid = uid; updated(); } QString IncidenceBase::uid() const { return mUid; } |