summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp34
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
@@ -96,36 +96,30 @@ QString KOAgendaItem::getWhatsThisText()
KOPrefs::instance()->mWTshowCreated,
KOPrefs::instance()->mWTshowChanged);
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
mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor;
}
else {
QStringList categories = mIncidence->categories();
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;
}
}
@@ -140,8 +134,18 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
BackgroundColor.dark(),BackgroundColor.light(),
BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ;
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);
setCellXWidth(0);
setSubCell(0);