summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoviewitem.cpp
Unidiff
Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoviewitem.cpp38
1 files changed, 29 insertions, 9 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 6559119..66f8d06 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -21,4 +21,5 @@
21#include <kdebug.h> 21#include <kdebug.h>
22#include <qapp.h> 22#include <qapp.h>
23#include <kglobal.h>
23 24
24#include <kiconloader.h> 25#include <kiconloader.h>
@@ -121,22 +122,33 @@ void KOTodoViewItem::construct()
121 122
122 123
124 keyd = "";
125 keyt = "";
126
127 if (mTodo->isRunning() ) {
128 QDate d = mTodo->runStart().date();
129 QTime t = mTodo->runStart().time();
130 skeyt.sprintf("%02d%02d",t.hour(),t.minute());
131 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
132 keyd = KGlobal::locale()->formatDate( d );
133 keyt = KGlobal::locale()->formatTime( t );
134
135 } else {
136
123 if (mTodo->hasStartDate()) { 137 if (mTodo->hasStartDate()) {
124 setText(5, mTodo->dtStartDateStr()); 138 keyd = mTodo->dtStartDateStr();
125 QDate d = mTodo->dtStart().date(); 139 QDate d = mTodo->dtStart().date();
126 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 140 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
127 141
128 if (mTodo->doesFloat()) { 142 if ( !mTodo->doesFloat()) {
129 setText(6,""); 143 keyt = mTodo->dtStartTimeStr();
130 }
131 else {
132 setText(6,mTodo->dtStartTimeStr());
133 QTime t = mTodo->dtStart().time(); 144 QTime t = mTodo->dtStart().time();
134 skeyt.sprintf("%02d%02d",t.hour(),t.minute()); 145 skeyt.sprintf("%02d%02d",t.hour(),t.minute());
135 146
136 } 147 }
137 } else { 148
138 setText(5,"");
139 setText(6,"");
140 } 149 }
150 }
151 setText(5,keyd);
152 setText(6,keyt);
141 setSortKey(5,skeyd); 153 setSortKey(5,skeyd);
142 setSortKey(6,skeyt); 154 setSortKey(6,skeyt);
@@ -369,4 +381,11 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i
369 if ( !firstChild() ) 381 if ( !firstChild() )
370 openMode = false; 382 openMode = false;
383 bool colorRunning = mTodo->isRunning();
384 if ( ! colorRunning && openMode )
385 colorRunning = mTodo->hasRunningSub();
386 if ( colorRunning ) {
387 setColor = true;
388 colorToSet = KOPrefs::instance()->mTodoRunColor;
389 } else {
371 int odue = mTodo->hasDueSubTodo( openMode ); 390 int odue = mTodo->hasDueSubTodo( openMode );
372 if (odue == 2) { 391 if (odue == 2) {
@@ -377,4 +396,5 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i
377 setColor = true; 396 setColor = true;
378 } 397 }
398 }
379 399
380 400