From df0200487afbfa59b80a79e548d70b5203019003 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 05 Jan 2005 14:17:14 +0000 Subject: todo enhancements/fixes --- (limited to 'korganizer/kotodoviewitem.cpp') diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index ae0b334..347d982 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -79,6 +79,8 @@ void KOTodoViewItem::construct() m_init = true; QString keyd = "=="; QString keyt = "=="; + QString skeyd = "=="; + QString skeyt = "=="; setOn(mTodo->isCompleted()); setText(0,mTodo->summary()); @@ -96,7 +98,7 @@ void KOTodoViewItem::construct() setText(3, mTodo->dtDueDateStr()); QDate d = mTodo->dtDue().date(); keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); - setSortKey(3,keyd); + // setSortKey(3,keyd); if (mTodo->doesFloat()) { setText(4,""); } @@ -104,7 +106,7 @@ void KOTodoViewItem::construct() setText(4,mTodo->dtDueTimeStr()); QTime t = mTodo->dtDue().time(); keyt.sprintf("%02d%02d",t.hour(),t.minute()); - setSortKey(4,keyt); + //setSortKey(4,keyt); } } else { setText(3,""); @@ -116,8 +118,31 @@ void KOTodoViewItem::construct() if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); - setText(5,mTodo->cancelled() ? i18n("Yes") : i18n("No")); - setText(6,mTodo->categoriesStr()); + + + if (mTodo->hasStartDate()) { + setText(5, mTodo->dtStartDateStr()); + QDate d = mTodo->dtStart().date(); + skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); + + if (mTodo->doesFloat()) { + setText(6,""); + } + else { + setText(6,mTodo->dtStartTimeStr()); + QTime t = mTodo->dtStart().time(); + skeyt.sprintf("%02d%02d",t.hour(),t.minute()); + + } + } else { + setText(5,""); + setText(6,""); + } + setSortKey(5,skeyd); + setSortKey(6,skeyt); + + setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); + setText(8,mTodo->categoriesStr()); #if 0 // Find sort id in description. It's the text behind the last '#' character -- cgit v0.9.0.2