summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show 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
@@ -41,10 +41,21 @@ KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *
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;
}
}
@@ -88,12 +99,10 @@ void KOTodoViewItem::construct()
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());
@@ -115,10 +124,10 @@ void KOTodoViewItem::construct()
}
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 = "";