summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoviewitem.cpp
authorzautrix <zautrix>2005-04-09 20:21:58 (UTC)
committer zautrix <zautrix>2005-04-09 20:21:58 (UTC)
commit9e43ebbe5867b2da957bb17c35bd357715424cba (patch) (unidiff)
treeb506ba029b50fc46a33d35a39e6f1c768c995f22 /korganizer/kotodoviewitem.cpp
parent2c39ac46121e8796e780a5321ab777f08792e5ba (diff)
downloadkdepimpi-9e43ebbe5867b2da957bb17c35bd357715424cba.zip
kdepimpi-9e43ebbe5867b2da957bb17c35bd357715424cba.tar.gz
kdepimpi-9e43ebbe5867b2da957bb17c35bd357715424cba.tar.bz2
todo tt
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
@@ -20,6 +20,7 @@
20#include <klocale.h> 20#include <klocale.h>
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>
25#include "kotodoviewitem.h" 26#include "kotodoviewitem.h"
@@ -120,24 +121,35 @@ void KOTodoViewItem::construct()
120 121
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);
143 155
@@ -368,6 +380,13 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i
368 // maybe we are in flat-display-mode 380 // maybe we are in flat-display-mode
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) {
373 colorToSet = KOPrefs::instance()->mTodoOverdueColor; 392 colorToSet = KOPrefs::instance()->mTodoOverdueColor;
@@ -376,6 +395,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i
376 colorToSet = KOPrefs::instance()->mTodoDueTodayColor; 395 colorToSet = KOPrefs::instance()->mTodoDueTodayColor;
377 setColor = true; 396 setColor = true;
378 } 397 }
398 }
379 399
380 400
381 if ( setColor ) { 401 if ( setColor ) {