author | zautrix <zautrix> | 2005-01-30 12:08:19 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-30 12:08:19 (UTC) |
commit | 1bcef8b3f53419e7155e0862ad61e3e419763d70 (patch) (unidiff) | |
tree | 166b82db7bc30b7d55b042bd37bb92facea6cdf2 /korganizer/kotodoviewitem.cpp | |
parent | 446ea98a9f6550c4a3e64bcfc6aab8e8b58776e8 (diff) | |
download | kdepimpi-1bcef8b3f53419e7155e0862ad61e3e419763d70.zip kdepimpi-1bcef8b3f53419e7155e0862ad61e3e419763d70.tar.gz kdepimpi-1bcef8b3f53419e7155e0862ad61e3e419763d70.tar.bz2 |
fixes
Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 2822237..1edddac 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -203,15 +203,16 @@ void KOTodoViewItem::stateChange(bool state) | |||
203 | // qDebug("KOTodoViewItem::stateChange "); | 203 | // qDebug("KOTodoViewItem::stateChange "); |
204 | // do not change setting on startup | 204 | // do not change setting on startup |
205 | if ( m_init ) return; | 205 | if ( m_init ) return; |
206 | qDebug("KOTodoViewItem::stateChange "); | 206 | if (isOn()!=state) { |
207 | setOn(state); | ||
208 | //qDebug("SETON "); | ||
209 | return; | ||
210 | } | ||
207 | QString keyd = "=="; | 211 | QString keyd = "=="; |
208 | QString keyt = "=="; | 212 | QString keyt = "=="; |
209 | 213 | //qDebug("KOTodoViewItem::stateChange %s ", text(0).latin1()); | |
210 | mTodo->setCompleted(state); | 214 | mTodo->setCompleted(state); |
211 | if (state) mTodo->setCompleted(QDateTime::currentDateTime()); | 215 | if (state) mTodo->setCompleted(QDateTime::currentDateTime()); |
212 | if (isOn()!=state) { | ||
213 | setOn(state); | ||
214 | } | ||
215 | 216 | ||
216 | if (mTodo->hasDueDate()) { | 217 | if (mTodo->hasDueDate()) { |
217 | setText(3, mTodo->dtDueDateStr()); | 218 | setText(3, mTodo->dtDueDateStr()); |
@@ -240,12 +241,19 @@ void KOTodoViewItem::stateChange(bool state) | |||
240 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); | 241 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); |
241 | else setSortKey(2,QString::number(99)); | 242 | else setSortKey(2,QString::number(99)); |
242 | } | 243 | } |
243 | QListViewItem * myChild = firstChild(); | 244 | if ( state ) { |
244 | KOTodoViewItem *item; | 245 | QListViewItem * myChild = firstChild(); |
245 | while( myChild ) { | 246 | KOTodoViewItem *item; |
246 | item = static_cast<KOTodoViewItem*>(myChild); | 247 | while( myChild ) { |
247 | item->stateChange(state); | 248 | //qDebug("stateCH "); |
248 | myChild = myChild->nextSibling(); | 249 | item = static_cast<KOTodoViewItem*>(myChild); |
250 | item->stateChange(state); | ||
251 | myChild = myChild->nextSibling(); | ||
252 | } | ||
253 | } else { | ||
254 | QListViewItem * myChild = parent(); | ||
255 | if ( myChild ) | ||
256 | (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); | ||
249 | } | 257 | } |
250 | mTodoView->modified(true); | 258 | mTodoView->modified(true); |
251 | setMyPixmap(); | 259 | setMyPixmap(); |