author | zautrix <zautrix> | 2005-01-05 14:17:14 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-05 14:17:14 (UTC) |
commit | df0200487afbfa59b80a79e548d70b5203019003 (patch) (side-by-side diff) | |
tree | 2240de4162736461316c8cb3cd00f87a8a9bf2bd /korganizer/kotodoviewitem.cpp | |
parent | b8410daa179dbff2ebb833071ba50b9da36e6330 (diff) | |
download | kdepimpi-df0200487afbfa59b80a79e548d70b5203019003.zip kdepimpi-df0200487afbfa59b80a79e548d70b5203019003.tar.gz kdepimpi-df0200487afbfa59b80a79e548d70b5203019003.tar.bz2 |
todo enhancements/fixes
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 @@ -66,71 +66,96 @@ void KOTodoViewItem::setSortKey(int column,const QString &key) #if QT_VERSION >= 300 void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, int y,int h) { QListViewItem::paintBranches(p,cg,w,y,h); } #else #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())); } 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,""); } else { QString str = mTodo->description().mid(pos+1); str.stripWhiteSpace(); setText(6,str); } #endif m_known = false; |