-rw-r--r-- | core/pim/todo/todotable.cpp | 22 | ||||
-rw-r--r-- | core/pim/todo/todotable.h | 3 |
2 files changed, 13 insertions, 12 deletions
diff --git a/core/pim/todo/todotable.cpp b/core/pim/todo/todotable.cpp index 779b28c..15f733b 100644 --- a/core/pim/todo/todotable.cpp +++ b/core/pim/todo/todotable.cpp @@ -233,2 +233,3 @@ TodoTable::TodoTable( QWidget *parent, const char *name ) { + setNumRows(0); mCat.load( categoryFileName() ); @@ -248,3 +249,3 @@ TodoTable::TodoTable( QWidget *parent, const char *name ) setColumnWidth( 3, 20 ); - horizontalHeader()->setLabel( 3, tr( "Deadline" ) ); + horizontalHeader()->setLabel( 3, tr( "Deadline" ) ); @@ -315,3 +316,3 @@ void TodoTable::slotClicked( int row, int col, int, const QPoint &pos ) break; - case 3: + case 3: // may as well edit it... @@ -440,3 +441,3 @@ void TodoTable::updateVisible() return; - + if (showDeadl){ @@ -454,2 +455,5 @@ void TodoTable::updateVisible() ToDoEvent *t = todoList[ci]; + if (!t) + continue; + QArray<int> vlCats = t->categories(); @@ -601,3 +605,3 @@ void TodoTable::loadFile( const QString &/*we use the standard*/ ) list.append( event ); - } + } vaList.clear(); @@ -683,3 +687,3 @@ void TodoTable::keyPressEvent( QKeyEvent *e ) break; - } + } } else @@ -760,3 +764,3 @@ int TodoTable::showCategoryId() const } -void TodoTable::applyJournal() +void TodoTable::applyJournal() { @@ -811,3 +815,3 @@ void TodoTable::slotCheckDay() for(int i=0; i < numRows(); i++ ){ - ToDoEvent *t = todoList[static_cast<CheckItem*>(item(i, 0))]; + ToDoEvent *t = todoList[static_cast<CheckItem*>(item(i, 0))]; static_cast<DueTextItem*>(item(i, 3) )->setToDoEvent( t ); @@ -920,4 +924,4 @@ static ToDoEvent xmlToEvent( XMLElement *element ) QStringList ids = QStringList::split(";", dummy ); - event.setCategories( ids ); - + event.setCategories( ids ); + //uid diff --git a/core/pim/todo/todotable.h b/core/pim/todo/todotable.h index 7539df1..387dddb 100644 --- a/core/pim/todo/todotable.h +++ b/core/pim/todo/todotable.h @@ -194,5 +194,2 @@ inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) { - int rows = numRows(); - ++rows; - setNumRows( rows ); QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A') |