author | zautrix <zautrix> | 2005-01-27 12:14:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-27 12:14:32 (UTC) |
commit | c8b484570a9cf8aacc070f92141c8bcfebbf3a93 (patch) (side-by-side diff) | |
tree | af81a25ccc142582a60a5ed100dcd44956255b62 /korganizer/kowhatsnextview.cpp | |
parent | 9ff00e650e32d6f348a2333c9cf21da9c9a137ff (diff) | |
download | kdepimpi-c8b484570a9cf8aacc070f92141c8bcfebbf3a93.zip kdepimpi-c8b484570a9cf8aacc070f92141c8bcfebbf3a93.tar.gz kdepimpi-c8b484570a9cf8aacc070f92141c8bcfebbf3a93.tar.bz2 |
birthday fixes
Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 7166a01..4111c5d 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -595,16 +595,24 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a 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 ( ev->categories().contains( i18n("Birthday") ) || ev->categories().contains( i18n("Anniversary") ) ) { + noc = ev->getNextOccurence( cdt, &ok ); + if ( ok ) { + int 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; @@ -650,17 +658,20 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) // mText += "r"; // needClose =true; // } if ( needClose ) mText += "] "; if ( ev->cancelled() ) mText += "</font>"; mText += "<a href=\"todo:" + ev->uid() + "\">"; - mText += ev->summary(); + if ( ev->summary().length() > 0 ) + mText += ev->summary(); + else + mText += i18n("-no summary-"); mText += "</a>"; if ( ((Todo*)ev)->hasDueDate () ) { QString year = ""; int ye = ((Todo*)ev)->dtDue().date().year(); if ( QDateTime::currentDateTime().date().year() != ye ) year = QString::number( ye ); QString dfs = KGlobal::locale()->dateFormatShort(); KGlobal::locale()->setDateFormatShort("%d.%b"); |