author | zautrix <zautrix> | 2005-02-05 11:26:35 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-05 11:26:35 (UTC) |
commit | 86c0d35262454a31ed7d50d3e20cbdace954ebdf (patch) (side-by-side diff) | |
tree | 7ded091fe9111fe20014f8edbc5f338293e36386 /korganizer | |
parent | 3a822a4c4867acb28dc1b3b9557918d0971f732c (diff) | |
download | kdepimpi-86c0d35262454a31ed7d50d3e20cbdace954ebdf.zip kdepimpi-86c0d35262454a31ed7d50d3e20cbdace954ebdf.tar.gz kdepimpi-86c0d35262454a31ed7d50d3e20cbdace954ebdf.tar.bz2 |
another fixx
-rw-r--r-- | korganizer/komonthview.cpp | 2 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 18 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 9 |
3 files changed, 17 insertions, 12 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 31c5659..cb519b2 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -1193,25 +1193,25 @@ void KOMonthView::updateView() if ( end > timeSpan ) end = timeSpan; int iii; //qDebug("found %s %d %d ",event->summary().latin1(), st, end ); for ( iii = st;iii<= end;++iii) (*cells)[iii]->insertEvent( event ); } } } else { if ( invalid ) break; invalid = true; //qDebug("invalid %s", event->summary().latin1()); - incidenceStart = QDateTime( mStartDate ); + incidenceStart = QDateTime( mStartDate ).addSecs( -2 );; } if ( last ) break; bool ok; incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok ); if ( ! ok ) break; if ( incidenceStart.date() > endDate ) break; } } else { // no recur int st = event->dtStart().date().daysTo( endDate ); diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 6bdee18..78d4027 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -320,38 +320,34 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i // if (isAlternate()) // _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground()); bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors; QColor colorToSet; if ( setColor ) { QStringList categories = mTodo->categories(); QString cat = categories.first(); if ( !cat.isEmpty()) { 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); + + 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 ); if ( role == QColorGroup::Base) { int rgb = colorToSet.red(); rgb += colorToSet.blue()/2; rgb += colorToSet.green(); if ( rgb < 200 ) _cg.setColor(QColorGroup::Text,Qt::white ); } } //#endif diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index a2c20a8..5bc8c00 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1337,24 +1337,33 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); } else { startString = ": "+incidence->dtStartStr(true); startString += " --- "+((Event*)incidence)->dtEndStr(true); } } else { if ( incidence->dtStart().time() != incidence->dtEnd().time() ) startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); + 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); } } else startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); if ( !incidence->location().isEmpty() ) startString += " (" +incidence->location()+")"; setCaption( incidence->summary()+startString); enableIncidenceActions( true ); |