summaryrefslogtreecommitdiffabout
path: root/libkcal/incidencebase.cpp
authorzautrix <zautrix>2005-11-25 23:24:37 (UTC)
committer zautrix <zautrix>2005-11-25 23:24:37 (UTC)
commit3cd0013c04172b312ee21e80224a3b7734b4d413 (patch) (unidiff)
tree9c5557ecfe874a8a4901a674c5eddcc91f585b0c /libkcal/incidencebase.cpp
parent0e18027f386280bf427ef9d0ffec61a5516cebda (diff)
downloadkdepimpi-3cd0013c04172b312ee21e80224a3b7734b4d413.zip
kdepimpi-3cd0013c04172b312ee21e80224a3b7734b4d413.tar.gz
kdepimpi-3cd0013c04172b312ee21e80224a3b7734b4d413.tar.bz2
sync
Diffstat (limited to 'libkcal/incidencebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidencebase.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index cfef973..56c0560 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -91,128 +91,135 @@ bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 )
91 // do not compare mSyncStatus and mExternalId 91 // do not compare mSyncStatus and mExternalId
92 if( i1.attendees().count() != i2.attendees().count() ) { 92 if( i1.attendees().count() != i2.attendees().count() ) {
93 return false; // no need to check further 93 return false; // no need to check further
94 } 94 }
95 if ( i1.attendees().count() > 0 ) { 95 if ( i1.attendees().count() > 0 ) {
96 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ; 96 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ;
97 while ( a1 ) { 97 while ( a1 ) {
98 if ( !( (*a1) == (*a2)) ) 98 if ( !( (*a1) == (*a2)) )
99 { 99 {
100 //qDebug("Attendee not equal "); 100 //qDebug("Attendee not equal ");
101 return false; 101 return false;
102 } 102 }
103 a1 = i1.attendees().next(); 103 a1 = i1.attendees().next();
104 a2 = i2.attendees().next(); 104 a2 = i2.attendees().next();
105 } 105 }
106 } 106 }
107 //if ( i1.dtStart() != i2.dtStart() ) 107 //if ( i1.dtStart() != i2.dtStart() )
108 // return false; 108 // return false;
109#if 0 109#if 0
110 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() ); 110 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() );
111 qDebug("1 %d ",i1.duration() == i2.duration() ); 111 qDebug("1 %d ",i1.duration() == i2.duration() );
112 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() ); 112 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() );
113 qDebug("1 %d ",i1.pilotId() == i2.pilotId() ); 113 qDebug("1 %d ",i1.pilotId() == i2.pilotId() );
114 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() ); 114 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() );
115 qDebug("6 %d ",i1.organizer() == i2.organizer() ); 115 qDebug("6 %d ",i1.organizer() == i2.organizer() );
116 116
117#endif 117#endif
118 if ( i1.hasDuration() == i2.hasDuration() ) { 118 if ( i1.hasDuration() == i2.hasDuration() ) {
119 if ( i1.hasDuration() ) { 119 if ( i1.hasDuration() ) {
120 if ( i1.duration() != i2.duration() ) 120 if ( i1.duration() != i2.duration() )
121 return false; 121 return false;
122 } 122 }
123 } else { 123 } else {
124 return false; 124 return false;
125 } 125 }
126 126
127 return ( i1.organizer() == i2.organizer() && 127 return ( i1.organizer() == i2.organizer() &&
128 // i1.uid() == i2.uid() && 128 // i1.uid() == i2.uid() &&
129 // Don't compare lastModified, otherwise the operator is not 129 // Don't compare lastModified, otherwise the operator is not
130 // of much use. We are not comparing for identity, after all. 130 // of much use. We are not comparing for identity, after all.
131 i1.doesFloat() == i2.doesFloat() && 131 i1.doesFloat() == i2.doesFloat() &&
132 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() ); 132 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() );
133 // no need to compare mObserver 133 // no need to compare mObserver
134} 134}
135 135
136 136
137QDateTime IncidenceBase::getEvenTime( QDateTime dt ) 137QDateTime IncidenceBase::getEvenTime( QDateTime dt )
138{ 138{
139 QTime t = dt.time(); 139 QTime t = dt.time();
140 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); 140 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) );
141 return dt; 141 return dt;
142} 142}
143 143
144bool IncidenceBase::isTagged() const 144bool IncidenceBase::isTagged() const
145{ 145{
146 return mIsTagged; 146 return mIsTagged;
147} 147}
148void IncidenceBase::setTagged( bool b) 148void IncidenceBase::setTagged( bool b)
149{ 149{
150 mIsTagged = b; 150 mIsTagged = b;
151} 151}
152void IncidenceBase::setCalID( int id ) 152void IncidenceBase::setCalID( int id )
153{ 153{
154 if ( mCalID > 0 ) { 154 if ( mCalID > 0 ) {
155 updated();
156 }
157 mCalID = id;
158}
159void IncidenceBase::setCalID_block( int id )
160{
161 if ( mCalID > 0 ) {
155 blockLastModified = true; 162 blockLastModified = true;
156 updated(); 163 updated();
157 blockLastModified = false; 164 blockLastModified = false;
158 } 165 }
159 mCalID = id; 166 mCalID = id;
160} 167}
161int IncidenceBase::calID() const 168int IncidenceBase::calID() const
162{ 169{
163 return mCalID; 170 return mCalID;
164} 171}
165void IncidenceBase::setCalEnabled( bool b ) 172void IncidenceBase::setCalEnabled( bool b )
166{ 173{
167 mCalEnabled = b; 174 mCalEnabled = b;
168} 175}
169bool IncidenceBase::calEnabled() const 176bool IncidenceBase::calEnabled() const
170{ 177{
171 return mCalEnabled; 178 return mCalEnabled;
172} 179}
173 180
174void IncidenceBase::setAlarmEnabled( bool b ) 181void IncidenceBase::setAlarmEnabled( bool b )
175{ 182{
176 mAlarmEnabled = b; 183 mAlarmEnabled = b;
177} 184}
178bool IncidenceBase::alarmEnabled() const 185bool IncidenceBase::alarmEnabled() const
179{ 186{
180 return mAlarmEnabled; 187 return mAlarmEnabled;
181} 188}
182 189
183 190
184void IncidenceBase::setUid(const QString &uid) 191void IncidenceBase::setUid(const QString &uid)
185{ 192{
186 mUid = uid; 193 mUid = uid;
187 updated(); 194 updated();
188} 195}
189 196
190QString IncidenceBase::uid() const 197QString IncidenceBase::uid() const
191{ 198{
192 return mUid; 199 return mUid;
193} 200}
194void IncidenceBase::setLastModifiedSubInvalid() 201void IncidenceBase::setLastModifiedSubInvalid()
195{ 202{
196 // virtual method 203 // virtual method
197} 204}
198void IncidenceBase::setLastModified(const QDateTime &lm) 205void IncidenceBase::setLastModified(const QDateTime &lm)
199{ 206{
200 if ( blockLastModified ) return; 207 if ( blockLastModified ) return;
201 // DON'T! updated() because we call this from 208 // DON'T! updated() because we call this from
202 // Calendar::updateEvent(). 209 // Calendar::updateEvent().
203 mLastModified = getEvenTime(lm); 210 mLastModified = getEvenTime(lm);
204 mLastModifiedKey.sprintf("%04d%02d%02d%02d%02d%02d", 211 mLastModifiedKey.sprintf("%04d%02d%02d%02d%02d%02d",
205 mLastModified.date().year(), 212 mLastModified.date().year(),
206 mLastModified.date().month(), 213 mLastModified.date().month(),
207 mLastModified.date().day(), 214 mLastModified.date().day(),
208 mLastModified.time().hour(), 215 mLastModified.time().hour(),
209 mLastModified.time().minute(), 216 mLastModified.time().minute(),
210 mLastModified.time().second() ); 217 mLastModified.time().second() );
211 setLastModifiedSubInvalid(); 218 setLastModifiedSubInvalid();
212 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); 219 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1());
213} 220}
214QString IncidenceBase::lastModifiedSortKey() const 221QString IncidenceBase::lastModifiedSortKey() const
215{ 222{
216 return mLastModifiedKey; 223 return mLastModifiedKey;
217} 224}
218 225