summaryrefslogtreecommitdiffabout
path: root/libkcal/incidencebase.cpp
Unidiff
Diffstat (limited to 'libkcal/incidencebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidencebase.cpp11
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 )
85 } 85 }
86 if ( i1.attendees().count() > 0 ) { 86 if ( i1.attendees().count() > 0 ) {
87 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ; 87 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ;
88 while ( a1 ) { 88 while ( a1 ) {
89 if ( !( (*a1) == (*a2)) ) 89 if ( !( (*a1) == (*a2)) )
90 { 90 {
91 //qDebug("Attendee not equal "); 91 //qDebug("Attendee not equal ");
92 return false; 92 return false;
93 } 93 }
94 a1 = i1.attendees().next(); 94 a1 = i1.attendees().next();
95 a2 = i2.attendees().next(); 95 a2 = i2.attendees().next();
96 } 96 }
97 } 97 }
98 //if ( i1.dtStart() != i2.dtStart() ) 98 //if ( i1.dtStart() != i2.dtStart() )
99 // return false; 99 // return false;
100#if 0 100#if 0
101 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() ); 101 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() );
102 qDebug("1 %d ",i1.duration() == i2.duration() ); 102 qDebug("1 %d ",i1.duration() == i2.duration() );
103 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() ); 103 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() );
104 qDebug("1 %d ",i1.pilotId() == i2.pilotId() ); 104 qDebug("1 %d ",i1.pilotId() == i2.pilotId() );
105 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() ); 105 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() );
106 qDebug("6 %d ",i1.organizer() == i2.organizer() ); 106 qDebug("6 %d ",i1.organizer() == i2.organizer() );
107 107
108#endif 108#endif
109 if ( i1.hasDuration() == i2.hasDuration() ) {
110 if ( i1.hasDuration() ) {
111 if ( i1.duration() != i2.duration() )
112 return false;
113 }
114 } else {
115 return false;
116 }
117
109 return ( i1.organizer() == i2.organizer() && 118 return ( i1.organizer() == i2.organizer() &&
110 // i1.uid() == i2.uid() && 119 // i1.uid() == i2.uid() &&
111 // Don't compare lastModified, otherwise the operator is not 120 // Don't compare lastModified, otherwise the operator is not
112 // of much use. We are not comparing for identity, after all. 121 // of much use. We are not comparing for identity, after all.
113 i1.doesFloat() == i2.doesFloat() && 122 i1.doesFloat() == i2.doesFloat() &&
114 i1.duration() == i2.duration() &&
115 i1.hasDuration() == i2.hasDuration() &&
116 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() ); 123 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() );
117 // no need to compare mObserver 124 // no need to compare mObserver
118} 125}
119 126
120 127
121QDateTime IncidenceBase::getEvenTime( QDateTime dt ) 128QDateTime IncidenceBase::getEvenTime( QDateTime dt )
122{ 129{
123 QTime t = dt.time(); 130 QTime t = dt.time();
124 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); 131 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) );
125 return dt; 132 return dt;
126} 133}
127 134
128 135
129void IncidenceBase::setUid(const QString &uid) 136void IncidenceBase::setUid(const QString &uid)
130{ 137{
131 mUid = uid; 138 mUid = uid;
132 updated(); 139 updated();
133} 140}
134 141
135QString IncidenceBase::uid() const 142QString IncidenceBase::uid() const
136{ 143{
137 return mUid; 144 return mUid;
138} 145}
139 146