Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 10665f4..391b3bb 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -594,49 +594,53 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a needClose =true; } if ( ev->recurrence()->doesRecur() ) { if ( !needClose) tempText +="["; tempText += "r"; needClose =true; } if ( needClose ) { tempText += "] "; } if ( ev->cancelled() ) tempText += "</font>"; tempText += "<a "; if (ev->type()=="Event") tempText += "href=\"event:"; if (ev->type()=="Todo") tempText += "href=\"todo:"; tempText += ev->uid() + "\">"; if ( ev->summary().length() > 0 ) tempText += ev->summary(); else tempText += i18n("-no summary-"); if ( bDay ) { noc = ev->getNextOccurence( cdt.addDays(-1), &ok ); if ( ok ) { - int years = noc.date().year() - ev->dtStart().date().year(); + int years = 0; + if ( ev->type() =="Todo" ) { + years = noc.date().year() -((Todo*)ev)->dtDue().date().year(); + } else + years = noc.date().year() - ev->dtStart().date().year(); tempText += i18n(" (%1 y.)"). arg( years ); } } tempText += "</a>"; if ( KOPrefs::instance()->mWNViewShowLocation ) if ( !ev->location().isEmpty() ) tempText += " ("+ev->location() +")"; if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) tempText += " ["+ev->relatedTo()->summary() +"]"; tempText += "</td></tr>\n"; mText += tempText; return true; } bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) { if ( mTodos.find( ev ) != mTodos.end() ) return false; mTodos.append( ev ); if ( !isSub ) mText += "<p>"; else mText += "<li>"; |