summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoviewitem.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoviewitem.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 78d4027..44db209 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -257,25 +257,25 @@ void KOTodoViewItem::stateChange(bool state)
} else {
QListViewItem * myChild = parent();
if ( myChild )
(static_cast<KOTodoViewItem*>(myChild))->stateChange(state);
}
mTodoView->modified(true);
setMyPixmap();
mTodoView->setTodoModified( mTodo );
}
bool KOTodoViewItem::isAlternate()
{
-#ifndef KORG_NOLVALTERNATION
+
KOTodoListView *lv = static_cast<KOTodoListView *>(listView());
if (lv && lv->alternateBackground().isValid())
{
KOTodoViewItem *above = 0;
above = dynamic_cast<KOTodoViewItem *>(itemAbove());
m_known = above ? above->m_known : true;
if (m_known)
{
m_odd = above ? !above->m_odd : false;
}
else
{
@@ -294,40 +294,37 @@ bool KOTodoViewItem::isAlternate()
}
while(item)
{
item->m_odd = previous = !previous;
item->m_known = true;
item = dynamic_cast<KOTodoViewItem *>(item->nextSibling());
}
}
return m_odd;
}
return false;
-#else
- return false;
-#endif
}
void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
{
QColorGroup _cg = cg;
QColorGroup::ColorRole role;
if ( KOPrefs::instance()->mTodoViewUsesForegroundColor )
role = QColorGroup::Text;
else
role = QColorGroup::Base;
//#ifndef KORG_NOLVALTERNATION
- // if (isAlternate())
- // _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground());
+ if (isAlternate())
+ _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground());
bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors;
QColor colorToSet;
if ( setColor ) {
QStringList categories = mTodo->categories();
QString cat = categories.first();
if ( !cat.isEmpty()) {
colorToSet = *(KOPrefs::instance()->categoryColor(cat) );
} else
setColor = false;
}
int odue = mTodo->hasDueSubTodo( !isOpen());