author | zautrix <zautrix> | 2005-07-01 06:04:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-01 06:04:54 (UTC) |
commit | a7924287e231b461585c4121f6ee2ce32f955089 (patch) (side-by-side diff) | |
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 @@ -98,17 +98,11 @@ QString KOAgendaItem::getWhatsThisText() return "KOAgendaItem::getWhatsThisText()::internal error"; } -void KOAgendaItem::init ( Incidence *incidence, QDate qd ) + +void KOAgendaItem::initColor () { - mIncidence = incidence; - mDate = qd; - mFirstMultiItem = 0; - mNextMultiItem = 0; - mLastMultiItem = 0; - computeText(); - - if ( (incidence->typeID() == todoID ) && - ( !((static_cast<Todo*>(incidence))->isCompleted()) && - ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { - if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) + if ( (mIncidence->typeID() == todoID ) && + ( !((static_cast<Todo*>(mIncidence))->isCompleted()) && + ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { + if ( (static_cast<Todo*>(mIncidence))->dtDue() < QDateTime::currentDateTime().date()) mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; else @@ -119,11 +113,11 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) QString cat = categories.first(); if (cat.isEmpty()) { - if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) + if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; else - mBackgroundColor =KOPrefs::instance()->defaultColor( incidence->calID() ); + mBackgroundColor =KOPrefs::instance()->defaultColor( mIncidence->calID() ); } else { mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); - if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) { + if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) { if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; @@ -142,4 +136,14 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) setBackgroundColor( mBackgroundColor ); mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); +} +void KOAgendaItem::init ( Incidence *incidence, QDate qd ) +{ + mIncidence = incidence; + mDate = qd; + mFirstMultiItem = 0; + mNextMultiItem = 0; + mLastMultiItem = 0; + computeText(); + initColor(); mConflictItems.clear(); setCellXY(0,0,1); |