-rw-r--r-- | korganizer/kolistview.cpp | 21 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 14 |
2 files changed, 11 insertions, 24 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index b236c2d..4fc1194 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -141,12 +141,10 @@ bool ListItemVisitor::visit(Event *e) | |||
141 | mItem->setText(9,e->categoriesStr()); | 141 | mItem->setText(9,e->categoriesStr()); |
142 | mItem->setText(10, KOPrefs::instance()->calName( e->calID() )); | 142 | mItem->setText(10, KOPrefs::instance()->calName( e->calID() )); |
143 | mItem->setText(11, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); | 143 | mItem->setText(11, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); |
144 | mItem->setSortKey(11,e->lastModifiedSortKey()); | ||
144 | 145 | ||
145 | QString key; | 146 | QString key; |
146 | QDate d = e->lastModified().date(); | 147 | QTime t; |
147 | QTime t = e->lastModified().time(); | ||
148 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | ||
149 | mItem->setSortKey(12,key); | ||
150 | t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 148 | t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
151 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 149 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
152 | mItem->setSortKey(1,key); | 150 | mItem->setSortKey(1,key); |
@@ -200,11 +198,10 @@ bool ListItemVisitor::visit(Todo *t) | |||
200 | mItem->setText(9,t->categoriesStr()); | 198 | mItem->setText(9,t->categoriesStr()); |
201 | mItem->setText(10, KOPrefs::instance()->calName( t->calID() )); | 199 | mItem->setText(10, KOPrefs::instance()->calName( t->calID() )); |
202 | mItem->setText(11, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); | 200 | mItem->setText(11, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); |
201 | mItem->setSortKey(11,t->lastModifiedSortKey()); | ||
203 | QString key; | 202 | QString key; |
204 | QDate d = t->lastModified().date(); | 203 | QDate d; |
205 | QTime tm = t->lastModified().time(); | 204 | QTime tm; |
206 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); | ||
207 | mItem->setSortKey(11,key); | ||
208 | if (t->hasDueDate()) { | 205 | if (t->hasDueDate()) { |
209 | d = t->dtDue().date(); | 206 | d = t->dtDue().date(); |
210 | tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 207 | tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
@@ -246,17 +243,13 @@ bool ListItemVisitor::visit(Journal * j) | |||
246 | mItem->setText(9,j->categoriesStr()); | 243 | mItem->setText(9,j->categoriesStr()); |
247 | mItem->setText(10, KOPrefs::instance()->calName( j->calID() )); | 244 | mItem->setText(10, KOPrefs::instance()->calName( j->calID() )); |
248 | mItem->setText(11, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); | 245 | mItem->setText(11, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); |
246 | mItem->setSortKey(11,j->lastModifiedSortKey()); | ||
249 | 247 | ||
250 | QString key; | 248 | QString key; |
251 | QDate d = j->lastModified().date(); | 249 | QDate d; |
252 | QTime tm = j->lastModified().time(); | ||
253 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); | ||
254 | mItem->setSortKey(12,key); | ||
255 | d = j->dtStart().date(); | 250 | d = j->dtStart().date(); |
256 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 251 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
257 | mItem->setSortKey(1,key); | 252 | mItem->setSortKey(1,key); |
258 | mItem->setSortKey(7,key); | ||
259 | |||
260 | return true; | 253 | return true; |
261 | } | 254 | } |
262 | 255 | ||
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index bdef94c..848e9e7 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -119,8 +119,6 @@ void KOTodoViewItem::construct() | |||
119 | if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); | 119 | if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); |
120 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); | 120 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); |
121 | 121 | ||
122 | |||
123 | |||
124 | keyd = ""; | 122 | keyd = ""; |
125 | keyt = ""; | 123 | keyt = ""; |
126 | 124 | ||
@@ -160,18 +158,14 @@ void KOTodoViewItem::construct() | |||
160 | setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true )); | 158 | setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true )); |
161 | setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true )); | 159 | setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true )); |
162 | QString key; | 160 | QString key; |
163 | QDate d = mTodo->lastModified().date(); | 161 | QDate d; |
164 | QTime t = mTodo->lastModified().time(); | 162 | QTime t; |
165 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | 163 | setSortKey(9,mTodo->lastModifiedSortKey()); |
166 | setSortKey(9,key); | ||
167 | d = mTodo->created().date(); | 164 | d = mTodo->created().date(); |
168 | t = mTodo->created().time(); | 165 | t = mTodo->created().time(); |
169 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | 166 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); |
170 | setSortKey(10,key); | 167 | setSortKey(10,key); |
171 | d = mTodo->lastModifiedSub().date(); | 168 | setSortKey(11,mTodo->lastModifiedSubSortKey()); |
172 | t = mTodo->lastModifiedSub().time(); | ||
173 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | ||
174 | setSortKey(11,key); | ||
175 | 169 | ||
176 | #if 0 | 170 | #if 0 |
177 | // Find sort id in description. It's the text behind the last '#' character | 171 | // Find sort id in description. It's the text behind the last '#' character |