-rw-r--r-- | korganizer/komonthview.cpp | 3 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 425496a..6d6ae8a 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -364,80 +364,79 @@ void MonthViewItem::paint(QPainter *p) | |||
364 | } | 364 | } |
365 | x += sizeM/2 + 1; | 365 | x += sizeM/2 + 1; |
366 | x += sizeM + 1; | 366 | x += sizeM + 1; |
367 | } | 367 | } |
368 | 368 | ||
369 | if ( mIncidence->type() == "Todo" ){ | 369 | if ( mIncidence->type() == "Todo" ){ |
370 | Todo* td = ( Todo* ) mIncidence; | 370 | Todo* td = ( Todo* ) mIncidence; |
371 | if ( td->isCompleted() ) { | 371 | if ( td->isCompleted() ) { |
372 | int half = size/2; | 372 | int half = size/2; |
373 | p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ; | 373 | p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ; |
374 | p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ; | 374 | p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ; |
375 | x += half+half + 4; | 375 | x += half+half + 4; |
376 | 376 | ||
377 | } else { | 377 | } else { |
378 | int val = td->percentComplete()/20; | 378 | int val = td->percentComplete()/20; |
379 | p->fillRect ( x+1, y-2, val ,size+4,Qt::black ); | 379 | p->fillRect ( x+1, y-2, val ,size+4,Qt::black ); |
380 | p->drawRect ( x, y-2,7,size+4); | 380 | p->drawRect ( x, y-2,7,size+4); |
381 | x += size + 3; | 381 | x += size + 3; |
382 | } | 382 | } |
383 | } | 383 | } |
384 | QFontMetrics fm = p->fontMetrics(); | 384 | QFontMetrics fm = p->fontMetrics(); |
385 | int yPos; | 385 | int yPos; |
386 | int pmheight = size; | 386 | int pmheight = size; |
387 | if( pmheight < fm.height() ) | 387 | if( pmheight < fm.height() ) |
388 | yPos = fm.ascent() + fm.leading()/2; | 388 | yPos = fm.ascent() + fm.leading()/2; |
389 | else | 389 | else |
390 | yPos = pmheight/2 - fm.height()/2 + fm.ascent(); | 390 | yPos = pmheight/2 - fm.height()/2 + fm.ascent(); |
391 | p->setPen( palette().color( QPalette::Normal, sel ? \ | 391 | p->setPen( palette().color( QPalette::Normal, sel ? \ |
392 | QColorGroup::HighlightedText : QColorGroup::Foreground ) ); | 392 | QColorGroup::HighlightedText : QColorGroup::Foreground ) ); |
393 | p->drawText( x, yPos, text() ); | 393 | p->drawText( x, yPos, text() ); |
394 | if ( mIncidence->cancelled() ) { | 394 | if ( mIncidence->cancelled() ) { |
395 | int wid = fm.width( text() ); | 395 | int wid = fm.width( text() ); |
396 | p->drawLine( x, heihei/2-1 ,x+wid, heihei/2-1 ); | 396 | p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); |
397 | } | 397 | } |
398 | 398 | ||
399 | } | 399 | } |
400 | 400 | ||
401 | int MonthViewItem::height(const QListBox *lb) const | 401 | int MonthViewItem::height(const QListBox *lb) const |
402 | { | 402 | { |
403 | int ret = 10; | 403 | int ret = 10; |
404 | if ( lb ) | 404 | if ( lb ) |
405 | ret = lb->fontMetrics().lineSpacing()+1; | 405 | ret = lb->fontMetrics().lineSpacing()+1; |
406 | return ret; | 406 | return ret; |
407 | } | 407 | } |
408 | 408 | ||
409 | int MonthViewItem::width(const QListBox *lb) const | 409 | int MonthViewItem::width(const QListBox *lb) const |
410 | { | 410 | { |
411 | |||
412 | if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { | 411 | if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { |
413 | int size = PIXMAP_SIZE; | 412 | int size = PIXMAP_SIZE; |
414 | if ( QApplication::desktop()->width() < 300 ) | 413 | if ( QApplication::desktop()->width() < 300 ) |
415 | size = 3; | 414 | size = 3; |
416 | int x = 1; | 415 | int x = 1; |
417 | if ( KOPrefs::instance()->mMonthShowIcons ) { | 416 | if ( KOPrefs::instance()->mMonthShowIcons ) { |
418 | if ( mInfo ) { | 417 | if ( mInfo ) { |
419 | x += size + 1; | 418 | x += size + 1; |
420 | } | 419 | } |
421 | if( mRecur ) { | 420 | if( mRecur ) { |
422 | x += size+1; | 421 | x += size+1; |
423 | } | 422 | } |
424 | if( mAlarm ) { | 423 | if( mAlarm ) { |
425 | x += size+1; | 424 | x += size+1; |
426 | } | 425 | } |
427 | if( mReply ) { | 426 | if( mReply ) { |
428 | x += size+1; | 427 | x += size+1; |
429 | } | 428 | } |
430 | } | 429 | } |
431 | if( mMultiday ) { | 430 | if( mMultiday ) { |
432 | x += size+1+2+size/2; | 431 | x += size+1+2+size/2; |
433 | } | 432 | } |
434 | return( x + lb->fontMetrics().width( text() ) + 1 ); | 433 | return( x + lb->fontMetrics().width( text() ) + 1 ); |
435 | } | 434 | } |
436 | if ( ! lb ) | 435 | if ( ! lb ) |
437 | return 10; | 436 | return 10; |
438 | //qDebug("ret wid %d ", lb->width()); | 437 | //qDebug("ret wid %d ", lb->width()); |
439 | return lb->width(); | 438 | return lb->width(); |
440 | } | 439 | } |
441 | 440 | ||
442 | 441 | ||
443 | MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) | 442 | MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) |
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 9a36939..a312ba5 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -219,64 +219,65 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) | |||
219 | i1.categories() == i2.categories() && | 219 | i1.categories() == i2.categories() && |
220 | // no need to compare mRelatedTo | 220 | // no need to compare mRelatedTo |
221 | stringCompare( i1.relatedToUid(), i2.relatedToUid() ) && | 221 | stringCompare( i1.relatedToUid(), i2.relatedToUid() ) && |
222 | // i1.relations() == i2.relations() && | 222 | // i1.relations() == i2.relations() && |
223 | i1.exDates() == i2.exDates() && | 223 | i1.exDates() == i2.exDates() && |
224 | i1.attachments() == i2.attachments() && | 224 | i1.attachments() == i2.attachments() && |
225 | i1.resources() == i2.resources() && | 225 | i1.resources() == i2.resources() && |
226 | i1.secrecy() == i2.secrecy() && | 226 | i1.secrecy() == i2.secrecy() && |
227 | i1.priority() == i2.priority() && | 227 | i1.priority() == i2.priority() && |
228 | i1.cancelled() == i2.cancelled() && | 228 | i1.cancelled() == i2.cancelled() && |
229 | stringCompare( i1.location(), i2.location() ); | 229 | stringCompare( i1.location(), i2.location() ); |
230 | } | 230 | } |
231 | 231 | ||
232 | Incidence* Incidence::recreateCloneException( QDate d ) | 232 | Incidence* Incidence::recreateCloneException( QDate d ) |
233 | { | 233 | { |
234 | Incidence* newInc = clone(); | 234 | Incidence* newInc = clone(); |
235 | newInc->recreate(); | 235 | newInc->recreate(); |
236 | if ( doesRecur() ) { | 236 | if ( doesRecur() ) { |
237 | addExDate( d ); | 237 | addExDate( d ); |
238 | newInc->recurrence()->unsetRecurs(); | 238 | newInc->recurrence()->unsetRecurs(); |
239 | if ( type() == "Event") { | 239 | if ( type() == "Event") { |
240 | int len = dtStart().secsTo( ((Event*)this)->dtEnd()); | 240 | int len = dtStart().secsTo( ((Event*)this)->dtEnd()); |
241 | QTime tim = dtStart().time(); | 241 | QTime tim = dtStart().time(); |
242 | newInc->setDtStart( QDateTime(d, tim) ); | 242 | newInc->setDtStart( QDateTime(d, tim) ); |
243 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); | 243 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); |
244 | } else { | 244 | } else { |
245 | int len = dtStart().secsTo( ((Todo*)this)->dtDue()); | 245 | int len = dtStart().secsTo( ((Todo*)this)->dtDue()); |
246 | QTime tim = ((Todo*)this)->dtDue().time(); | 246 | QTime tim = ((Todo*)this)->dtDue().time(); |
247 | ((Todo*)newInc)->setDtDue( QDateTime(d, tim) ); | 247 | ((Todo*)newInc)->setDtDue( QDateTime(d, tim) ); |
248 | ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) ); | 248 | ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) ); |
249 | ((Todo*)this)->setRecurDates(); | 249 | ((Todo*)this)->setRecurDates(); |
250 | } | 250 | } |
251 | newInc->setExDates( DateList () ); | ||
251 | } | 252 | } |
252 | return newInc; | 253 | return newInc; |
253 | } | 254 | } |
254 | 255 | ||
255 | void Incidence::recreate() | 256 | void Incidence::recreate() |
256 | { | 257 | { |
257 | setCreated(QDateTime::currentDateTime()); | 258 | setCreated(QDateTime::currentDateTime()); |
258 | 259 | ||
259 | setUid(CalFormat::createUniqueId()); | 260 | setUid(CalFormat::createUniqueId()); |
260 | 261 | ||
261 | setRevision(0); | 262 | setRevision(0); |
262 | setIDStr( ":" ); | 263 | setIDStr( ":" ); |
263 | setLastModified(QDateTime::currentDateTime()); | 264 | setLastModified(QDateTime::currentDateTime()); |
264 | } | 265 | } |
265 | 266 | ||
266 | void Incidence::setReadOnly( bool readOnly ) | 267 | void Incidence::setReadOnly( bool readOnly ) |
267 | { | 268 | { |
268 | IncidenceBase::setReadOnly( readOnly ); | 269 | IncidenceBase::setReadOnly( readOnly ); |
269 | recurrence()->setRecurReadOnly( readOnly); | 270 | recurrence()->setRecurReadOnly( readOnly); |
270 | } | 271 | } |
271 | 272 | ||
272 | void Incidence::setCreated(QDateTime created) | 273 | void Incidence::setCreated(QDateTime created) |
273 | { | 274 | { |
274 | if (mReadOnly) return; | 275 | if (mReadOnly) return; |
275 | mCreated = getEvenTime(created); | 276 | mCreated = getEvenTime(created); |
276 | } | 277 | } |
277 | 278 | ||
278 | QDateTime Incidence::created() const | 279 | QDateTime Incidence::created() const |
279 | { | 280 | { |
280 | return mCreated; | 281 | return mCreated; |
281 | } | 282 | } |
282 | 283 | ||