summaryrefslogtreecommitdiffabout
path: root/korganizer/kowhatsnextview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kowhatsnextview.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 7166a01..4111c5d 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -579,48 +579,56 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
if ( !needClose)
tempText +="[";
tempText += "i";
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 ( 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;
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>";
mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] ";
mText += ind;
@@ -634,49 +642,52 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
if ( !needClose)
mText +="[";
mText += "a";
needClose =true;
}
if ( ev->description().length() > 0 ) {
if ( !needClose)
mText +="[";
mText += "i";
needClose =true;
}
// if ( ev->recurrence()->doesRecur() ) {
// if ( !needClose)
// mText +="(";
// mText += "r";
// needClose =true;
// }
if ( needClose )
mText += "] ";
if ( ev->cancelled() )
mText += "</font>";
mText += "<a href=\"todo:" + ev->uid() + "\">";
+ 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");
mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>";
KGlobal::locale()->setDateFormatShort(dfs);
}
if ( KOPrefs::instance()->mWNViewShowLocation )
if ( !ev->location().isEmpty() )
mText += " ("+ev->location() +")";
if ( !isSub ) {
if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents)
mText += " ["+ev->relatedTo()->summary() +"]";
mText += "</p>\n";
}
else {
ind += "-";
mText += "</li>\n";
}
QPtrList<Incidence> Relations = ev->relations();