-rw-r--r-- | korganizer/kolistview.cpp | 21 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 14 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 13 | ||||
-rw-r--r-- | libkcal/incidence.h | 2 | ||||
-rw-r--r-- | libkcal/incidencebase.cpp | 13 | ||||
-rw-r--r-- | libkcal/incidencebase.h | 2 |
6 files changed, 40 insertions, 25 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index b236c2d..4fc1194 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -132,30 +132,28 @@ bool ListItemVisitor::visit(Event *e) | |||
132 | if ( e->isAlarmEnabled() ) { | 132 | if ( e->isAlarmEnabled() ) { |
133 | mItem->setText(6,e->alarms().first()->offsetText() ); | 133 | mItem->setText(6,e->alarms().first()->offsetText() ); |
134 | } else { | 134 | } else { |
135 | mItem->setText(6, i18n("No")); | 135 | mItem->setText(6, i18n("No")); |
136 | } | 136 | } |
137 | mItem->setText(7, e->recurrenceText()); | 137 | mItem->setText(7, e->recurrenceText()); |
138 | if( ! e->doesRecur() ) | 138 | if( ! e->doesRecur() ) |
139 | mItem->setSortKey( 7, "-" ); | 139 | mItem->setSortKey( 7, "-" ); |
140 | mItem->setText(8, e->cancelled() ? i18n("Yes") : i18n("No")); | 140 | mItem->setText(8, e->cancelled() ? i18n("Yes") : i18n("No")); |
141 | mItem->setText(9,e->categoriesStr()); | 141 | mItem->setText(9,e->categoriesStr()); |
142 | mItem->setText(10, KOPrefs::instance()->calName( e->calID() )); | 142 | mItem->setText(10, KOPrefs::instance()->calName( e->calID() )); |
143 | mItem->setText(11, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); | 143 | mItem->setText(11, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); |
144 | mItem->setSortKey(11,e->lastModifiedSortKey()); | ||
144 | 145 | ||
145 | QString key; | 146 | QString key; |
146 | QDate d = e->lastModified().date(); | 147 | QTime t; |
147 | QTime t = e->lastModified().time(); | ||
148 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | ||
149 | mItem->setSortKey(12,key); | ||
150 | t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 148 | t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
151 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 149 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
152 | mItem->setSortKey(1,key); | 150 | mItem->setSortKey(1,key); |
153 | 151 | ||
154 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 152 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
155 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 153 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
156 | mItem->setSortKey(3,key); | 154 | mItem->setSortKey(3,key); |
157 | return true; | 155 | return true; |
158 | } | 156 | } |
159 | 157 | ||
160 | bool ListItemVisitor::visit(Todo *t) | 158 | bool ListItemVisitor::visit(Todo *t) |
161 | { | 159 | { |
@@ -191,29 +189,28 @@ bool ListItemVisitor::visit(Todo *t) | |||
191 | } else { | 189 | } else { |
192 | mItem->setText(4,t->dtDueTimeStr()); | 190 | mItem->setText(4,t->dtDueTimeStr()); |
193 | } | 191 | } |
194 | } else { | 192 | } else { |
195 | mItem->setText(3,"---"); | 193 | mItem->setText(3,"---"); |
196 | mItem->setText(4,"---"); | 194 | mItem->setText(4,"---"); |
197 | } | 195 | } |
198 | mItem->setText(5, t->durationText()); | 196 | mItem->setText(5, t->durationText()); |
199 | mItem->setText(8, t->cancelled() ? i18n("Yes") : i18n("No")); | 197 | mItem->setText(8, t->cancelled() ? i18n("Yes") : i18n("No")); |
200 | mItem->setText(9,t->categoriesStr()); | 198 | mItem->setText(9,t->categoriesStr()); |
201 | mItem->setText(10, KOPrefs::instance()->calName( t->calID() )); | 199 | mItem->setText(10, KOPrefs::instance()->calName( t->calID() )); |
202 | mItem->setText(11, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); | 200 | mItem->setText(11, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); |
201 | mItem->setSortKey(11,t->lastModifiedSortKey()); | ||
203 | QString key; | 202 | QString key; |
204 | QDate d = t->lastModified().date(); | 203 | QDate d; |
205 | QTime tm = t->lastModified().time(); | 204 | QTime tm; |
206 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); | ||
207 | mItem->setSortKey(11,key); | ||
208 | if (t->hasDueDate()) { | 205 | if (t->hasDueDate()) { |
209 | d = t->dtDue().date(); | 206 | d = t->dtDue().date(); |
210 | tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 207 | tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
211 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 208 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
212 | mItem->setSortKey(3,key); | 209 | mItem->setSortKey(3,key); |
213 | } | 210 | } |
214 | if ( t->hasStartDate() ) { | 211 | if ( t->hasStartDate() ) { |
215 | d = t->dtStart().date(); | 212 | d = t->dtStart().date(); |
216 | tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); | 213 | tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); |
217 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 214 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
218 | mItem->setSortKey(1,key); | 215 | mItem->setSortKey(1,key); |
219 | } | 216 | } |
@@ -237,35 +234,31 @@ bool ListItemVisitor::visit(Journal * j) | |||
237 | mItem->setSortKey(0,"0"+ des.left(25)); | 234 | mItem->setSortKey(0,"0"+ des.left(25)); |
238 | mItem->setText(1,j->dtStartDateStr()); | 235 | mItem->setText(1,j->dtStartDateStr()); |
239 | mItem->setText(2,"---"); | 236 | mItem->setText(2,"---"); |
240 | mItem->setText(3,"---"); | 237 | mItem->setText(3,"---"); |
241 | mItem->setText(4,"---"); | 238 | mItem->setText(4,"---"); |
242 | mItem->setText(5,"---"); | 239 | mItem->setText(5,"---"); |
243 | mItem->setText(6,"---"); | 240 | mItem->setText(6,"---"); |
244 | mItem->setText(7,"---"); | 241 | mItem->setText(7,"---"); |
245 | mItem->setText(8,"---"); | 242 | mItem->setText(8,"---"); |
246 | mItem->setText(9,j->categoriesStr()); | 243 | mItem->setText(9,j->categoriesStr()); |
247 | mItem->setText(10, KOPrefs::instance()->calName( j->calID() )); | 244 | mItem->setText(10, KOPrefs::instance()->calName( j->calID() )); |
248 | mItem->setText(11, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); | 245 | mItem->setText(11, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); |
246 | mItem->setSortKey(11,j->lastModifiedSortKey()); | ||
249 | 247 | ||
250 | QString key; | 248 | QString key; |
251 | QDate d = j->lastModified().date(); | 249 | QDate d; |
252 | QTime tm = j->lastModified().time(); | ||
253 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); | ||
254 | mItem->setSortKey(12,key); | ||
255 | d = j->dtStart().date(); | 250 | d = j->dtStart().date(); |
256 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 251 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
257 | mItem->setSortKey(1,key); | 252 | mItem->setSortKey(1,key); |
258 | mItem->setSortKey(7,key); | ||
259 | |||
260 | return true; | 253 | return true; |
261 | } | 254 | } |
262 | 255 | ||
263 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 256 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
264 | const char *name) | 257 | const char *name) |
265 | : KOEventView(calendar, parent, name) | 258 | : KOEventView(calendar, parent, name) |
266 | { | 259 | { |
267 | 260 | ||
268 | mActiveItem = 0; | 261 | mActiveItem = 0; |
269 | mForceShowCompletedTodos = false; | 262 | mForceShowCompletedTodos = false; |
270 | mListView = new KOListViewListView(this); | 263 | mListView = new KOListViewListView(this); |
271 | mListView->addColumn(i18n("Summary")); | 264 | mListView->addColumn(i18n("Summary")); |
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index bdef94c..848e9e7 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -110,26 +110,24 @@ void KOTodoViewItem::construct() | |||
110 | //setSortKey(4,keyt); | 110 | //setSortKey(4,keyt); |
111 | } | 111 | } |
112 | } else { | 112 | } else { |
113 | setText(3,""); | 113 | setText(3,""); |
114 | setText(4,""); | 114 | setText(4,""); |
115 | } | 115 | } |
116 | setSortKey(3,keyd); | 116 | setSortKey(3,keyd); |
117 | setSortKey(4,keyt); | 117 | setSortKey(4,keyt); |
118 | 118 | ||
119 | if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); | 119 | if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); |
120 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); | 120 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); |
121 | 121 | ||
122 | |||
123 | |||
124 | keyd = ""; | 122 | keyd = ""; |
125 | keyt = ""; | 123 | keyt = ""; |
126 | 124 | ||
127 | if (mTodo->isRunning() ) { | 125 | if (mTodo->isRunning() ) { |
128 | QDate d = mTodo->runStart().date(); | 126 | QDate d = mTodo->runStart().date(); |
129 | QTime t = mTodo->runStart().time(); | 127 | QTime t = mTodo->runStart().time(); |
130 | skeyt.sprintf("%02d%02d",t.hour(),t.minute()); | 128 | skeyt.sprintf("%02d%02d",t.hour(),t.minute()); |
131 | skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 129 | skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
132 | keyd = KGlobal::locale()->formatDate( d , true); | 130 | keyd = KGlobal::locale()->formatDate( d , true); |
133 | keyt = KGlobal::locale()->formatTime( t ); | 131 | keyt = KGlobal::locale()->formatTime( t ); |
134 | 132 | ||
135 | } else { | 133 | } else { |
@@ -151,36 +149,32 @@ void KOTodoViewItem::construct() | |||
151 | setText(5,keyd); | 149 | setText(5,keyd); |
152 | setText(6,keyt); | 150 | setText(6,keyt); |
153 | setSortKey(5,skeyd); | 151 | setSortKey(5,skeyd); |
154 | setSortKey(6,skeyt); | 152 | setSortKey(6,skeyt); |
155 | 153 | ||
156 | //setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); | 154 | //setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); |
157 | setText(7,mTodo->categoriesStr()); | 155 | setText(7,mTodo->categoriesStr()); |
158 | setText(8,KOPrefs::instance()->calName( mTodo->calID())); | 156 | setText(8,KOPrefs::instance()->calName( mTodo->calID())); |
159 | setText(9, KGlobal::locale()->formatDateTime( mTodo->lastModified(), true, true )); | 157 | setText(9, KGlobal::locale()->formatDateTime( mTodo->lastModified(), true, true )); |
160 | setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true )); | 158 | setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true )); |
161 | setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true )); | 159 | setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true )); |
162 | QString key; | 160 | QString key; |
163 | QDate d = mTodo->lastModified().date(); | 161 | QDate d; |
164 | QTime t = mTodo->lastModified().time(); | 162 | QTime t; |
165 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | 163 | setSortKey(9,mTodo->lastModifiedSortKey()); |
166 | setSortKey(9,key); | ||
167 | d = mTodo->created().date(); | 164 | d = mTodo->created().date(); |
168 | t = mTodo->created().time(); | 165 | t = mTodo->created().time(); |
169 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | 166 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); |
170 | setSortKey(10,key); | 167 | setSortKey(10,key); |
171 | d = mTodo->lastModifiedSub().date(); | 168 | setSortKey(11,mTodo->lastModifiedSubSortKey()); |
172 | t = mTodo->lastModifiedSub().time(); | ||
173 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | ||
174 | setSortKey(11,key); | ||
175 | 169 | ||
176 | #if 0 | 170 | #if 0 |
177 | // Find sort id in description. It's the text behind the last '#' character | 171 | // Find sort id in description. It's the text behind the last '#' character |
178 | // found in the description. White spaces are removed from beginning and end | 172 | // found in the description. White spaces are removed from beginning and end |
179 | // of sort id. | 173 | // of sort id. |
180 | int pos = mTodo->description().findRev('#'); | 174 | int pos = mTodo->description().findRev('#'); |
181 | if (pos < 0) { | 175 | if (pos < 0) { |
182 | setText(6,""); | 176 | setText(6,""); |
183 | } else { | 177 | } else { |
184 | QString str = mTodo->description().mid(pos+1); | 178 | QString str = mTodo->description().mid(pos+1); |
185 | str.stripWhiteSpace(); | 179 | str.stripWhiteSpace(); |
186 | setText(6,str); | 180 | setText(6,str); |
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 39c14f5..fe9f854 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -333,37 +333,50 @@ void Incidence::cloneRelations( Incidence * newInc ) | |||
333 | void Incidence::setReadOnly( bool readOnly ) | 333 | void Incidence::setReadOnly( bool readOnly ) |
334 | { | 334 | { |
335 | IncidenceBase::setReadOnly( readOnly ); | 335 | IncidenceBase::setReadOnly( readOnly ); |
336 | if ( mRecurrence ) | 336 | if ( mRecurrence ) |
337 | mRecurrence->setRecurReadOnly( readOnly); | 337 | mRecurrence->setRecurReadOnly( readOnly); |
338 | } | 338 | } |
339 | void Incidence::setLastModifiedSubInvalid() | 339 | void Incidence::setLastModifiedSubInvalid() |
340 | { | 340 | { |
341 | mLastModifiedSub = QDateTime(); | 341 | mLastModifiedSub = QDateTime(); |
342 | if ( mRelatedTo ) | 342 | if ( mRelatedTo ) |
343 | mRelatedTo->setLastModifiedSubInvalid(); | 343 | mRelatedTo->setLastModifiedSubInvalid(); |
344 | } | 344 | } |
345 | QString Incidence::lastModifiedSubSortKey() const | ||
346 | { | ||
347 | if ( mLastModifiedSubSortKey.isEmpty() ) | ||
348 | return lastModifiedSortKey(); | ||
349 | return mLastModifiedSubSortKey; | ||
350 | } | ||
345 | QDateTime Incidence::lastModifiedSub() | 351 | QDateTime Incidence::lastModifiedSub() |
346 | { | 352 | { |
347 | if ( !mRelations.count() ) | 353 | if ( !mRelations.count() ) |
348 | return lastModified(); | 354 | return lastModified(); |
349 | if ( mLastModifiedSub.isValid() ) | 355 | if ( mLastModifiedSub.isValid() ) |
350 | return mLastModifiedSub; | 356 | return mLastModifiedSub; |
351 | mLastModifiedSub = lastModified(); | 357 | mLastModifiedSub = lastModified(); |
352 | Incidence * inc; | 358 | Incidence * inc; |
353 | QPtrList<Incidence> Relations = relations(); | 359 | QPtrList<Incidence> Relations = relations(); |
354 | for (inc=Relations.first();inc;inc=Relations.next()) { | 360 | for (inc=Relations.first();inc;inc=Relations.next()) { |
355 | if ( inc->lastModifiedSub() > mLastModifiedSub ) | 361 | if ( inc->lastModifiedSub() > mLastModifiedSub ) |
356 | mLastModifiedSub = inc->lastModifiedSub(); | 362 | mLastModifiedSub = inc->lastModifiedSub(); |
357 | } | 363 | } |
364 | mLastModifiedSubSortKey.sprintf("%04d%02d%02d%02d%02d%02d", | ||
365 | mLastModifiedSub.date().year(), | ||
366 | mLastModifiedSub.date().month(), | ||
367 | mLastModifiedSub.date().day(), | ||
368 | mLastModifiedSub.time().hour(), | ||
369 | mLastModifiedSub.time().minute(), | ||
370 | mLastModifiedSub.time().second() ); | ||
358 | return mLastModifiedSub; | 371 | return mLastModifiedSub; |
359 | } | 372 | } |
360 | void Incidence::setCreated(QDateTime created) | 373 | void Incidence::setCreated(QDateTime created) |
361 | { | 374 | { |
362 | if (mReadOnly) return; | 375 | if (mReadOnly) return; |
363 | mCreated = getEvenTime(created); | 376 | mCreated = getEvenTime(created); |
364 | } | 377 | } |
365 | 378 | ||
366 | QDateTime Incidence::created() const | 379 | QDateTime Incidence::created() const |
367 | { | 380 | { |
368 | return mCreated; | 381 | return mCreated; |
369 | } | 382 | } |
diff --git a/libkcal/incidence.h b/libkcal/incidence.h index eef9e64..dc49640 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h | |||
@@ -270,37 +270,39 @@ class Incidence : public IncidenceBase | |||
270 | void setCancelled( bool b ); | 270 | void setCancelled( bool b ); |
271 | 271 | ||
272 | bool hasRecurrenceID() const; | 272 | bool hasRecurrenceID() const; |
273 | void setHasRecurrenceID( bool b ); | 273 | void setHasRecurrenceID( bool b ); |
274 | 274 | ||
275 | void setRecurrenceID(QDateTime); | 275 | void setRecurrenceID(QDateTime); |
276 | QDateTime recurrenceID () const; | 276 | QDateTime recurrenceID () const; |
277 | QDateTime dtStart() const; | 277 | QDateTime dtStart() const; |
278 | bool isHoliday() const; | 278 | bool isHoliday() const; |
279 | bool isBirthday() const; | 279 | bool isBirthday() const; |
280 | bool isAnniversary() const; | 280 | bool isAnniversary() const; |
281 | QDateTime lastModifiedSub(); | 281 | QDateTime lastModifiedSub(); |
282 | QString lastModifiedSubSortKey() const; | ||
282 | QString recurrenceText() const; | 283 | QString recurrenceText() const; |
283 | void setLastModifiedSubInvalid(); | 284 | void setLastModifiedSubInvalid(); |
284 | 285 | ||
285 | virtual QString durationText(); | 286 | virtual QString durationText(); |
286 | QString durationText4Time( int secs ); | 287 | QString durationText4Time( int secs ); |
287 | Recurrence *mRecurrence; | 288 | Recurrence *mRecurrence; |
288 | protected: | 289 | protected: |
289 | QPtrList<Alarm> mAlarms; | 290 | QPtrList<Alarm> mAlarms; |
290 | QPtrList<Incidence> mRelations; | 291 | QPtrList<Incidence> mRelations; |
291 | QDateTime mRecurrenceID; | 292 | QDateTime mRecurrenceID; |
292 | bool mHasRecurrenceID; | 293 | bool mHasRecurrenceID; |
293 | private: | 294 | private: |
294 | void checkCategories(); | 295 | void checkCategories(); |
296 | QString mLastModifiedSubSortKey; | ||
295 | bool mHoliday, mBirthday, mAnniversary; | 297 | bool mHoliday, mBirthday, mAnniversary; |
296 | int mRevision; | 298 | int mRevision; |
297 | bool mCancelled; | 299 | bool mCancelled; |
298 | 300 | ||
299 | // base components of jounal, event and todo | 301 | // base components of jounal, event and todo |
300 | QDateTime mCreated; | 302 | QDateTime mCreated; |
301 | QDateTime mLastModifiedSub; | 303 | QDateTime mLastModifiedSub; |
302 | QString mDescription; | 304 | QString mDescription; |
303 | QString mSummary; | 305 | QString mSummary; |
304 | QStringList mCategories; | 306 | QStringList mCategories; |
305 | Incidence *mRelatedTo; | 307 | Incidence *mRelatedTo; |
306 | QString mRelatedToUid; | 308 | QString mRelatedToUid; |
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 022dead..cfef973 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp | |||
@@ -184,35 +184,46 @@ bool IncidenceBase::alarmEnabled() const | |||
184 | void IncidenceBase::setUid(const QString &uid) | 184 | void IncidenceBase::setUid(const QString &uid) |
185 | { | 185 | { |
186 | mUid = uid; | 186 | mUid = uid; |
187 | updated(); | 187 | updated(); |
188 | } | 188 | } |
189 | 189 | ||
190 | QString IncidenceBase::uid() const | 190 | QString IncidenceBase::uid() const |
191 | { | 191 | { |
192 | return mUid; | 192 | return mUid; |
193 | } | 193 | } |
194 | void IncidenceBase::setLastModifiedSubInvalid() | 194 | void IncidenceBase::setLastModifiedSubInvalid() |
195 | { | 195 | { |
196 | 196 | // virtual method | |
197 | } | 197 | } |
198 | void IncidenceBase::setLastModified(const QDateTime &lm) | 198 | void IncidenceBase::setLastModified(const QDateTime &lm) |
199 | { | 199 | { |
200 | if ( blockLastModified ) return; | 200 | if ( blockLastModified ) return; |
201 | // DON'T! updated() because we call this from | 201 | // DON'T! updated() because we call this from |
202 | // Calendar::updateEvent(). | 202 | // Calendar::updateEvent(). |
203 | mLastModified = getEvenTime(lm); | 203 | mLastModified = getEvenTime(lm); |
204 | mLastModifiedKey.sprintf("%04d%02d%02d%02d%02d%02d", | ||
205 | mLastModified.date().year(), | ||
206 | mLastModified.date().month(), | ||
207 | mLastModified.date().day(), | ||
208 | mLastModified.time().hour(), | ||
209 | mLastModified.time().minute(), | ||
210 | mLastModified.time().second() ); | ||
204 | setLastModifiedSubInvalid(); | 211 | setLastModifiedSubInvalid(); |
205 | //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); | 212 | //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); |
206 | } | 213 | } |
214 | QString IncidenceBase::lastModifiedSortKey() const | ||
215 | { | ||
216 | return mLastModifiedKey; | ||
217 | } | ||
207 | 218 | ||
208 | QDateTime IncidenceBase::lastModified() const | 219 | QDateTime IncidenceBase::lastModified() const |
209 | { | 220 | { |
210 | return mLastModified; | 221 | return mLastModified; |
211 | } | 222 | } |
212 | 223 | ||
213 | void IncidenceBase::setOrganizer(const QString &o) | 224 | void IncidenceBase::setOrganizer(const QString &o) |
214 | { | 225 | { |
215 | // we don't check for readonly here, because it is | 226 | // we don't check for readonly here, because it is |
216 | // possible that by setting the organizer we are changing | 227 | // possible that by setting the organizer we are changing |
217 | // the event's readonly status... | 228 | // the event's readonly status... |
218 | mOrganizer = o; | 229 | mOrganizer = o; |
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index 665c1f6..444d4c4 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h | |||
@@ -54,24 +54,25 @@ class IncidenceBase : public CustomProperties | |||
54 | virtual QCString type() const = 0; | 54 | virtual QCString type() const = 0; |
55 | virtual IncTypeID typeID() const = 0; | 55 | virtual IncTypeID typeID() const = 0; |
56 | 56 | ||
57 | /** Set the unique id for the event */ | 57 | /** Set the unique id for the event */ |
58 | void setUid(const QString &); | 58 | void setUid(const QString &); |
59 | /** Return the unique id for the event */ | 59 | /** Return the unique id for the event */ |
60 | QString uid() const; | 60 | QString uid() const; |
61 | 61 | ||
62 | /** Sets the time the incidence was last modified. */ | 62 | /** Sets the time the incidence was last modified. */ |
63 | void setLastModified(const QDateTime &lm); | 63 | void setLastModified(const QDateTime &lm); |
64 | /** Return the time the incidence was last modified. */ | 64 | /** Return the time the incidence was last modified. */ |
65 | QDateTime lastModified() const; | 65 | QDateTime lastModified() const; |
66 | QString lastModifiedSortKey() const; | ||
66 | 67 | ||
67 | /** sets the organizer for the event */ | 68 | /** sets the organizer for the event */ |
68 | void setOrganizer(const QString &o); | 69 | void setOrganizer(const QString &o); |
69 | QString organizer() const; | 70 | QString organizer() const; |
70 | 71 | ||
71 | /** Set readonly status. */ | 72 | /** Set readonly status. */ |
72 | virtual void setReadOnly( bool ); | 73 | virtual void setReadOnly( bool ); |
73 | /** Return if the object is read-only. */ | 74 | /** Return if the object is read-only. */ |
74 | bool isReadOnly() const { return mReadOnly; } | 75 | bool isReadOnly() const { return mReadOnly; } |
75 | 76 | ||
76 | /** for setting the event's starting date/time with a QDateTime. */ | 77 | /** for setting the event's starting date/time with a QDateTime. */ |
77 | virtual void setDtStart(const QDateTime &dtStart); | 78 | virtual void setDtStart(const QDateTime &dtStart); |
@@ -151,24 +152,25 @@ class IncidenceBase : public CustomProperties | |||
151 | void setTagged( bool ); | 152 | void setTagged( bool ); |
152 | virtual void setLastModifiedSubInvalid(); | 153 | virtual void setLastModifiedSubInvalid(); |
153 | protected: | 154 | protected: |
154 | bool blockLastModified; | 155 | bool blockLastModified; |
155 | bool mIsTagged; | 156 | bool mIsTagged; |
156 | QDateTime mDtStart; | 157 | QDateTime mDtStart; |
157 | bool mReadOnly; | 158 | bool mReadOnly; |
158 | QDateTime getEvenTime( QDateTime ); | 159 | QDateTime getEvenTime( QDateTime ); |
159 | 160 | ||
160 | private: | 161 | private: |
161 | // base components | 162 | // base components |
162 | QString mOrganizer; | 163 | QString mOrganizer; |
164 | QString mLastModifiedKey; | ||
163 | QString mUid; | 165 | QString mUid; |
164 | int mCalID; | 166 | int mCalID; |
165 | bool mCalEnabled; | 167 | bool mCalEnabled; |
166 | bool mAlarmEnabled; | 168 | bool mAlarmEnabled; |
167 | QDateTime mLastModified; | 169 | QDateTime mLastModified; |
168 | QPtrList<Attendee> mAttendees; | 170 | QPtrList<Attendee> mAttendees; |
169 | 171 | ||
170 | bool mFloats; | 172 | bool mFloats; |
171 | 173 | ||
172 | int mDuration; | 174 | int mDuration; |
173 | bool mHasDuration; | 175 | bool mHasDuration; |
174 | QString mExternalId; | 176 | QString mExternalId; |