author | zautrix <zautrix> | 2005-07-01 06:04:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-01 06:04:54 (UTC) |
commit | a7924287e231b461585c4121f6ee2ce32f955089 (patch) (unidiff) | |
tree | 992d503b50212e72d69d845bd8d27cb8f8518c30 /korganizer/koagendaitem.cpp | |
parent | 7da83cbf37b406a523e36a948039941840d48fb1 (diff) | |
download | kdepimpi-a7924287e231b461585c4121f6ee2ce32f955089.zip kdepimpi-a7924287e231b461585c4121f6ee2ce32f955089.tar.gz kdepimpi-a7924287e231b461585c4121f6ee2ce32f955089.tar.bz2 |
fixxx
-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 | |||
@@ -94,40 +94,34 @@ QString KOAgendaItem::getWhatsThisText() | |||
94 | return KIncidenceFormatter::instance()->getFormattedText( mIncidence, | 94 | return KIncidenceFormatter::instance()->getFormattedText( mIncidence, |
95 | KOPrefs::instance()->mWTshowDetails, | 95 | KOPrefs::instance()->mWTshowDetails, |
96 | KOPrefs::instance()->mWTshowCreated, | 96 | KOPrefs::instance()->mWTshowCreated, |
97 | KOPrefs::instance()->mWTshowChanged); | 97 | KOPrefs::instance()->mWTshowChanged); |
98 | return "KOAgendaItem::getWhatsThisText()::internal error"; | 98 | return "KOAgendaItem::getWhatsThisText()::internal error"; |
99 | } | 99 | } |
100 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | ||
101 | { | ||
102 | mIncidence = incidence; | ||
103 | mDate = qd; | ||
104 | mFirstMultiItem = 0; | ||
105 | mNextMultiItem = 0; | ||
106 | mLastMultiItem = 0; | ||
107 | computeText(); | ||
108 | 100 | ||
109 | if ( (incidence->typeID() == todoID ) && | 101 | void KOAgendaItem::initColor () |
110 | ( !((static_cast<Todo*>(incidence))->isCompleted()) && | 102 | { |
111 | ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { | 103 | if ( (mIncidence->typeID() == todoID ) && |
112 | if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) | 104 | ( !((static_cast<Todo*>(mIncidence))->isCompleted()) && |
105 | ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { | ||
106 | if ( (static_cast<Todo*>(mIncidence))->dtDue() < QDateTime::currentDateTime().date()) | ||
113 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; | 107 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; |
114 | else | 108 | else |
115 | mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; | 109 | mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; |
116 | } | 110 | } |
117 | else { | 111 | else { |
118 | QStringList categories = mIncidence->categories(); | 112 | QStringList categories = mIncidence->categories(); |
119 | QString cat = categories.first(); | 113 | QString cat = categories.first(); |
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 ) |
129 | mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; | 123 | mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; |
130 | } | 124 | } |
131 | } | 125 | } |
132 | 126 | ||
133 | } | 127 | } |
@@ -138,12 +132,22 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | |||
138 | } | 132 | } |
139 | mColorGroup = QColorGroup( BackgroundColor.light(), | 133 | mColorGroup = QColorGroup( BackgroundColor.light(), |
140 | BackgroundColor.dark(),BackgroundColor.light(), | 134 | BackgroundColor.dark(),BackgroundColor.light(), |
141 | BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; | 135 | BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; |
142 | setBackgroundColor( mBackgroundColor ); | 136 | setBackgroundColor( mBackgroundColor ); |
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(); |
145 | setCellXY(0,0,1); | 149 | setCellXY(0,0,1); |
146 | setCellXWidth(0); | 150 | setCellXWidth(0); |
147 | setSubCell(0); | 151 | setSubCell(0); |
148 | setSubCells(1); | 152 | setSubCells(1); |
149 | setMultiItem(0,0,0); | 153 | setMultiItem(0,0,0); |