-rw-r--r-- | core/pim/todo/todotable.h | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/core/pim/todo/todotable.h b/core/pim/todo/todotable.h index 288ff90..32df514 100644 --- a/core/pim/todo/todotable.h +++ b/core/pim/todo/todotable.h | |||
@@ -78,4 +78,17 @@ public: | |||
78 | }; | 78 | }; |
79 | 79 | ||
80 | class DueTextItem : public QTableItem | ||
81 | { | ||
82 | public: | ||
83 | DueTextItem( QTable *t, ToDoEvent *ev ); | ||
84 | QString key() const; | ||
85 | void setToDoEvent( const ToDoEvent *ev ); | ||
86 | void paint( QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected ); | ||
87 | private: | ||
88 | int m_off; | ||
89 | bool m_hasDate:1; | ||
90 | bool m_completed:1; | ||
91 | |||
92 | }; | ||
80 | 93 | ||
81 | 94 | ||
@@ -99,5 +112,4 @@ public: | |||
99 | bool showCompleted() const { return showComp; } | 112 | bool showCompleted() const { return showComp; } |
100 | 113 | ||
101 | /* added 20.01.2k2 by se */ | ||
102 | void setShowDeadline (bool sd) {showDeadl = sd; updateVisible();} | 114 | void setShowDeadline (bool sd) {showDeadl = sd; updateVisible();} |
103 | bool showDeadline() const { return showDeadl;} | 115 | bool showDeadline() const { return showDeadl;} |
@@ -164,7 +176,5 @@ private: | |||
164 | Categories mCat; | 176 | Categories mCat; |
165 | int currFindRow; | 177 | int currFindRow; |
166 | 178 | bool showDeadl:1; | |
167 | /* added 20.01.2k2 by se */ | ||
168 | bool showDeadl; | ||
169 | }; | 179 | }; |
170 | 180 | ||
@@ -182,17 +192,6 @@ inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) | |||
182 | ti->setReplaceable( false ); | 192 | ti->setReplaceable( false ); |
183 | 193 | ||
184 | /* added 20.01.2k2 by se */ | 194 | DueTextItem *due = new DueTextItem(this, todo ); |
185 | QTableItem *dl = NULL; | 195 | setItem( row, 3, due); |
186 | if (todo->hasDate()){ | ||
187 | QDate *today = new QDate (QDate::currentDate()); | ||
188 | if (today){ | ||
189 | dl = new TodoTextItem (this, tr ("%1"). | ||
190 | arg(today->daysTo(todo->date()))); | ||
191 | delete (today); | ||
192 | } | ||
193 | }else{ | ||
194 | dl = new TodoTextItem (this,"n.d."); | ||
195 | } | ||
196 | setItem( row, 3, dl); | ||
197 | 196 | ||
198 | setItem( row, 0, chk ); | 197 | setItem( row, 0, chk ); |
@@ -206,7 +205,8 @@ inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) | |||
206 | inline void TodoTable::realignTable( int row ) | 205 | inline void TodoTable::realignTable( int row ) |
207 | { | 206 | { |
208 | QTableItem *ti1, | 207 | QTableItem *ti1, |
209 | *ti2, | 208 | *ti2, |
210 | *ti3; | 209 | *ti3, |
210 | *ti4; | ||
211 | int totalRows = numRows(); | 211 | int totalRows = numRows(); |
212 | for ( int curr = row; curr < totalRows - 1; curr++ ) { | 212 | for ( int curr = row; curr < totalRows - 1; curr++ ) { |
@@ -218,10 +218,13 @@ inline void TodoTable::realignTable( int row ) | |||
218 | ti2 = item( curr + 1, 1 ); | 218 | ti2 = item( curr + 1, 1 ); |
219 | ti3 = item( curr + 1, 2 ); | 219 | ti3 = item( curr + 1, 2 ); |
220 | ti4 = item( curr + 1, 3 ); | ||
220 | takeItem( ti1 ); | 221 | takeItem( ti1 ); |
221 | takeItem( ti2 ); | 222 | takeItem( ti2 ); |
222 | takeItem( ti3 ); | 223 | takeItem( ti3 ); |
224 | takeItem( ti4 ); | ||
223 | setItem( curr, 0, ti1 ); | 225 | setItem( curr, 0, ti1 ); |
224 | setItem( curr, 1, ti2 ); | 226 | setItem( curr, 1, ti2 ); |
225 | setItem( curr, 2, ti3 ); | 227 | setItem( curr, 2, ti3 ); |
228 | setItem( curr, 3, ti4 ); | ||
226 | } | 229 | } |
227 | setNumRows( totalRows - 1 ); | 230 | setNumRows( totalRows - 1 ); |