summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoviewitem.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 848e9e7..519bb16 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -38,16 +38,27 @@ KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *
{
construct();
}
QString KOTodoViewItem::key(int column,bool) const
{
+ if ( column == 0 )
+ return text(0).lower();
+ if ( column == 1 ) {
+ if ( mTodo->isCompleted() ) {
+ return "6"+QString::number(mTodo->priority())+text(0).lower();
+ }
+ return QString::number(mTodo->priority())+text(0).lower();
+ }
QMap<int,QString>::ConstIterator it = mKeyMap.find(column);
if (it == mKeyMap.end()) {
return text(column).lower();
} else {
+ if ( column == 2 ) {
+ return *it+text(0).lower();
+ }
return *it;
}
}
void KOTodoViewItem:: setup()
{
@@ -85,18 +96,16 @@ void KOTodoViewItem::construct()
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()));
+ setSortKey(2,QString::number(mTodo->percentComplete()));
}
else {
- if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
- else setSortKey(2,QString::number(99));
+ setSortKey(2,"999");
}
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);
@@ -112,16 +121,16 @@ void KOTodoViewItem::construct()
} else {
setText(3,"");
setText(4,"");
}
setSortKey(3,keyd);
setSortKey(4,keyt);
-
+#if 0
if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt);
else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
-
+#endif
keyd = "";
keyt = "";
if (mTodo->isRunning() ) {
QDate d = mTodo->runStart().date();
QTime t = mTodo->runStart().time();