summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 63fdecd..9b817bc 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1416,6 +1416,7 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i
int selDay;
- if ( !backgroundOnly )
+ QDate curDate = QDate::currentDate();
+ if ( !backgroundOnly ) {
for ( selDay = 0; selDay < mSelectedDates.count(); ++selDay)
{
- if ( mSelectedDates[selDay] == QDateTime::currentDateTime ().date() && KOPrefs::instance()->mHighlightCurrentDay) {
+ if ( mSelectedDates[selDay] == curDate && KOPrefs::instance()->mHighlightCurrentDay) {
int x1 = cx;
@@ -1447,2 +1448,3 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i
}
+ }
// Highlight working hours
@@ -1475,3 +1477,3 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i
if (xEnd > x2) xEnd = x2;
- if ( mSelectedDates[gxStart] == QDateTime::currentDateTime ().date()&& KOPrefs::instance()->mHighlightCurrentDay ) {
+ if ( mSelectedDates[gxStart] == curDate && KOPrefs::instance()->mHighlightCurrentDay ) {
if ( KOPrefs::instance()->mUseHighlightLightColor )
@@ -1678,4 +1680,4 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
//qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ ");
- bool overdue = (!todo->isCompleted()) && (todo->dtDue() < QDate::currentDate())&& ( KOPrefs::instance()->mShowTodoInAgenda );
- QDate currentDate;
+ QDate currentDate = QDate::currentDate();
+ bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda );
QDateTime dt;
@@ -1686,3 +1688,2 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
if ( overdue ) {
- currentDate = QDate::currentDate();
days += todo->dtDue().date().daysTo( currentDate );