From 86c0d35262454a31ed7d50d3e20cbdace954ebdf Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 05 Feb 2005 11:26:35 +0000 Subject: another fixx --- (limited to 'korganizer') diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 31c5659..cb519b2 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -1202,7 +1202,7 @@ void KOMonthView::updateView() break; invalid = true; //qDebug("invalid %s", event->summary().latin1()); - incidenceStart = QDateTime( mStartDate ); + incidenceStart = QDateTime( mStartDate ).addSecs( -2 );; } if ( last ) break; diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 6bdee18..78d4027 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -328,21 +328,17 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i colorToSet = *(KOPrefs::instance()->categoryColor(cat) ); } else setColor = false; - } - if (mTodo->hasDueDate()) { - if (mTodo->dtDue().date()==QDate::currentDate() && - !mTodo->isCompleted()) { - //_cg.setColor( role , KOPrefs::instance()->mTodoDueTodayColor); - colorToSet = KOPrefs::instance()->mTodoDueTodayColor; - setColor = true; - } - if (mTodo->dtDue().date() < QDate::currentDate() && - !mTodo->isCompleted()) { - //_cg.setColor( role, KOPrefs::instance()->mTodoOverdueColor); - colorToSet = KOPrefs::instance()->mTodoOverdueColor; - setColor = true; - } - } + } + + int odue = mTodo->hasDueSubTodo( !isOpen()); + if (odue == 2) { + colorToSet = KOPrefs::instance()->mTodoOverdueColor; + setColor = true; + } else if ( odue == 1 ) { + colorToSet = KOPrefs::instance()->mTodoDueTodayColor; + setColor = true; + } + if ( setColor ) { _cg.setColor(role,colorToSet ); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index a2c20a8..5bc8c00 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1346,7 +1346,16 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) if ( incidence->dtStart().time() != incidence->dtEnd().time() ) startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); - startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); + if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { + bool ok; + QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); + if ( ok ) { + int years = noc.date().year() - incidence->dtStart().date().year(); + startString += i18n(" (%1 y.)"). arg( years ); + } + } + else + startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); } } -- cgit v0.9.0.2