Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 66 |
1 files changed, 58 insertions, 8 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 0cf6e4c..bdef94c 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -154,8 +154,24 @@ void KOTodoViewItem::construct() setSortKey(6,skeyt); - setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); - setText(8,mTodo->categoriesStr()); - setText(9,KOPrefs::instance()->calName( mTodo->calID())); - + //setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); + setText(7,mTodo->categoriesStr()); + setText(8,KOPrefs::instance()->calName( mTodo->calID())); + setText(9, KGlobal::locale()->formatDateTime( mTodo->lastModified(), true, true )); + setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true )); + setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true )); + QString key; + QDate d = mTodo->lastModified().date(); + QTime t = mTodo->lastModified().time(); + key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); + setSortKey(9,key); + d = mTodo->created().date(); + t = mTodo->created().time(); + key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); + setSortKey(10,key); + d = mTodo->lastModifiedSub().date(); + t = mTodo->lastModifiedSub().time(); + key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); + setSortKey(11,key); + #if 0 // Find sort id in description. It's the text behind the last '#' character @@ -318,10 +334,42 @@ void KOTodoViewItem::stateChange(bool state) bool KOTodoViewItem::isAlternate() { - +#if 0 + //if ( m_known ) return m_odd; + //qDebug("test "); + KOTodoViewItem *item = static_cast<KOTodoViewItem *>(itemAbove()); + if ( item ) { + m_known = item->m_known; + if ( m_known ) { + m_odd = !item->m_odd ; + return m_odd; + } + } else { + item = static_cast<KOTodoViewItem *>(itemBelow()); + if ( item ) { + m_known = item->m_known; + if ( m_known ) { + m_odd = !item->m_odd ; + return m_odd; + } + } + } KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); - if (lv && lv->alternateBackground().isValid()) + item = static_cast<KOTodoViewItem *>(lv->firstChild()); + bool previous = true; + qDebug("WHILE "); + while ( item ) { + item->m_odd = !previous; + item->m_known = true; + previous = !previous; + item = static_cast<KOTodoViewItem *>(item->itemBelow()); + } + return m_odd; + +#else + + //KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); + //if (lv && lv->alternateBackground().isValid()) { - KOTodoViewItem *above = 0; - above = static_cast<KOTodoViewItem *>(itemAbove()); + KOTodoViewItem *above = static_cast<KOTodoViewItem *>(itemAbove()); m_known = above ? above->m_known : true; if (m_known) @@ -342,4 +390,5 @@ bool KOTodoViewItem::isAlternate() else { + KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); item = static_cast<KOTodoViewItem *>(lv->firstChild()); } @@ -355,4 +404,5 @@ bool KOTodoViewItem::isAlternate() } return false; +#endif } |