Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index ae0b334..347d982 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -74,16 +74,18 @@ void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, #endif void KOTodoViewItem::construct() { // qDebug("KOTodoViewItem::construct() "); m_init = true; QString keyd = "=="; QString keyt = "=="; + QString skeyd = "=="; + QString skeyt = "=="; setOn(mTodo->isCompleted()); setText(0,mTodo->summary()); setText(1,QString::number(mTodo->priority())); setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); if (mTodo->percentComplete()<100) { if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); else setSortKey(2,QString::number(mTodo->percentComplete())); @@ -91,38 +93,61 @@ void KOTodoViewItem::construct() else { if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); else setSortKey(2,QString::number(99)); } if (mTodo->hasDueDate()) { 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,""); } else { 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,""); setText(4,""); } setSortKey(3,keyd); setSortKey(4,keyt); 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 // found in the description. White spaces are removed from beginning and end // of sort id. int pos = mTodo->description().findRev('#'); if (pos < 0) { setText(6,""); |