diff -r b0711afde476 -r fa7c359294fa notes/notesui/notesmodel/src/notesmodel.cpp --- a/notes/notesui/notesmodel/src/notesmodel.cpp Fri Sep 17 08:29:05 2010 +0300 +++ b/notes/notesui/notesmodel/src/notesmodel.cpp Mon Oct 04 00:15:49 2010 +0300 @@ -210,7 +210,7 @@ NotesNamespace::StatusRole).value(); if (entry.status() == entryStatus) { - if (AgendaEntry::TodoNeedsAction == entryStatus) { + if (AgendaEntry::TodoCompleted != entryStatus) { // Make sure that the old model index is removed. mSourceModel->removeRow(foundIndex.row()); mInCompTodoCount--; @@ -218,7 +218,7 @@ // Now insert the to-do. insertInCompTodoToModel(foundIndex, id); - } else if (AgendaEntry::TodoCompleted == entryStatus) { + } else { // Make sure that the old model index is removed. mSourceModel->removeRow(foundIndex.row()); mCompTodoCount--; @@ -228,7 +228,7 @@ } } else { - if (AgendaEntry::TodoNeedsAction == entryStatus) { + if (AgendaEntry::TodoCompleted != entryStatus) { // Here the to-do was marked completed. Hence we need to remove // the incompleted to-do and insert a completed to-do. mSourceModel->removeRow(foundIndex.row()); @@ -237,7 +237,7 @@ // Now insert the completed to-do. insertCompTodoToModel(foundIndex, id); - } else if (AgendaEntry::TodoCompleted == entryStatus) { + } else { // Here the to-do was marked incompleted. Hence we need to // remove the completed to-do and insert an incompleted to-do. mSourceModel->removeRow(foundIndex.row()); @@ -292,11 +292,11 @@ notify = insertNoteToModel(indexToNotify, id); } else if (AgendaEntry::TypeTodo == entry.type()) { - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { // Try to insert the to-do at its appropriate position. notify = insertInCompTodoToModel(indexToNotify, id); - } else if (AgendaEntry::TodoCompleted == entry.status()) { + } else { // Try to insert the to-do at its appropriate position. insertCompTodoToModel(indexToNotify, id); } @@ -340,7 +340,7 @@ } else if (entryType == AgendaEntry::TypeTodo) { if (entryStatus == AgendaEntry::TodoCompleted) { mCompTodoCount--; - } else if (entryStatus == AgendaEntry::TodoNeedsAction) { + } else { mInCompTodoCount--; } } @@ -436,7 +436,7 @@ } else { stringList << entry.summary(); } - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { // Read due date from agenda entry QString displayText; QString timeText(hbTrId("txt_notes_dblist_val_due_on_1")); @@ -595,10 +595,18 @@ AgendaEntry entry = agendaEntryList[idIter]; if (AgendaEntry::TypeTodo != entry.type()) { + // delete the inserted row in the model + mSourceModel->removeRow(modelIter); + // decrement the iterator + modelIter--; continue; } - if (AgendaEntry::TodoNeedsAction != entry.status()) { + if (AgendaEntry::TodoCompleted == entry.status()) { + // delete the inserted row in the model + mSourceModel->removeRow(modelIter); + // decrement the iterator + modelIter--; continue; } @@ -624,7 +632,7 @@ stringList << entry.summary(); } - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { // Read due date from agenda entry QString displayText; QString timeText(hbTrId("txt_notes_dblist_val_due_on_1")); @@ -897,7 +905,7 @@ } else { stringList << entry.summary(); } - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { // Read due date from agenda entry QString displayText; QString timeText(hbTrId("txt_notes_dblist_val_due_on_1"));