-rw-r--r-- | korganizer/koagendaitem.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index a8e0678..a42d07b 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -99,15 +99,9 @@ QString KOAgendaItem::getWhatsThisText() | |||
99 | } | 99 | } |
100 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | 100 | |
101 | void KOAgendaItem::initColor () | ||
101 | { | 102 | { |
102 | mIncidence = incidence; | 103 | if ( (mIncidence->typeID() == todoID ) && |
103 | mDate = qd; | 104 | ( !((static_cast<Todo*>(mIncidence))->isCompleted()) && |
104 | mFirstMultiItem = 0; | 105 | ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { |
105 | mNextMultiItem = 0; | 106 | if ( (static_cast<Todo*>(mIncidence))->dtDue() < QDateTime::currentDateTime().date()) |
106 | mLastMultiItem = 0; | ||
107 | computeText(); | ||
108 | |||
109 | if ( (incidence->typeID() == todoID ) && | ||
110 | ( !((static_cast<Todo*>(incidence))->isCompleted()) && | ||
111 | ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { | ||
112 | if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) | ||
113 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; | 107 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; |
@@ -120,9 +114,9 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | |||
120 | if (cat.isEmpty()) { | 114 | if (cat.isEmpty()) { |
121 | if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) | 115 | if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) |
122 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; | 116 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; |
123 | else | 117 | else |
124 | mBackgroundColor =KOPrefs::instance()->defaultColor( incidence->calID() ); | 118 | mBackgroundColor =KOPrefs::instance()->defaultColor( mIncidence->calID() ); |
125 | } else { | 119 | } else { |
126 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); | 120 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); |
127 | if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) { | 121 | if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) { |
128 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) | 122 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) |
@@ -143,2 +137,12 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | |||
143 | mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); | 137 | mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); |
138 | } | ||
139 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | ||
140 | { | ||
141 | mIncidence = incidence; | ||
142 | mDate = qd; | ||
143 | mFirstMultiItem = 0; | ||
144 | mNextMultiItem = 0; | ||
145 | mLastMultiItem = 0; | ||
146 | computeText(); | ||
147 | initColor(); | ||
144 | mConflictItems.clear(); | 148 | mConflictItems.clear(); |