-rw-r--r-- | core/pim/todo/todotable.cpp | 4 | ||||
-rw-r--r-- | core/pim/todo/todotable.h | 3 |
2 files changed, 4 insertions, 3 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 | |||
@@ -228,12 +228,13 @@ TodoTable::TodoTable( QWidget *parent, const char *name ) | |||
228 | showComp( true ), | 228 | showComp( true ), |
229 | enablePainting( true ), | 229 | enablePainting( true ), |
230 | mCat( 0 ), | 230 | mCat( 0 ), |
231 | currFindRow( -2 ), | 231 | currFindRow( -2 ), |
232 | showDeadl( true) | 232 | showDeadl( true) |
233 | { | 233 | { |
234 | setNumRows(0); | ||
234 | mCat.load( categoryFileName() ); | 235 | mCat.load( categoryFileName() ); |
235 | setSorting( TRUE ); | 236 | setSorting( TRUE ); |
236 | setSelectionMode( NoSelection ); | 237 | setSelectionMode( NoSelection ); |
237 | setColumnStretchable( 2, TRUE ); | 238 | setColumnStretchable( 2, TRUE ); |
238 | setColumnWidth( 0, 20 ); | 239 | setColumnWidth( 0, 20 ); |
239 | setColumnWidth( 1, 35 ); | 240 | setColumnWidth( 1, 35 ); |
@@ -449,12 +450,15 @@ void TodoTable::updateVisible() | |||
449 | 450 | ||
450 | int visible = 0; | 451 | int visible = 0; |
451 | int id = mCat.id( "Todo List", showCat ); | 452 | int id = mCat.id( "Todo List", showCat ); |
452 | for ( int row = 0; row < numRows(); row++ ) { | 453 | for ( int row = 0; row < numRows(); row++ ) { |
453 | CheckItem *ci = (CheckItem *)item( row, 0 ); | 454 | CheckItem *ci = (CheckItem *)item( row, 0 ); |
454 | ToDoEvent *t = todoList[ci]; | 455 | ToDoEvent *t = todoList[ci]; |
456 | if (!t) | ||
457 | continue; | ||
458 | |||
455 | QArray<int> vlCats = t->categories(); | 459 | QArray<int> vlCats = t->categories(); |
456 | bool hide = false; | 460 | bool hide = false; |
457 | if ( !showComp && ci->isChecked() ) | 461 | if ( !showComp && ci->isChecked() ) |
458 | hide = true; | 462 | hide = true; |
459 | if ( !showCat.isEmpty() ) { | 463 | if ( !showCat.isEmpty() ) { |
460 | if ( showCat == tr( "Unfiled" ) ) { | 464 | if ( showCat == tr( "Unfiled" ) ) { |
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 | |||
@@ -189,15 +189,12 @@ private: | |||
189 | bool showDeadl:1; | 189 | bool showDeadl:1; |
190 | }; | 190 | }; |
191 | 191 | ||
192 | 192 | ||
193 | inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) | 193 | inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) |
194 | { | 194 | { |
195 | int rows = numRows(); | ||
196 | ++rows; | ||
197 | setNumRows( rows ); | ||
198 | QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A') | 195 | QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A') |
199 | + todo->priority() ) | 196 | + todo->priority() ) |
200 | + Qtopia::buildSortKey( todo->description() ); | 197 | + Qtopia::buildSortKey( todo->description() ); |
201 | CheckItem *chk = new CheckItem( this, sortKey ); | 198 | CheckItem *chk = new CheckItem( this, sortKey ); |
202 | chk->setChecked( todo->isCompleted() ); | 199 | chk->setChecked( todo->isCompleted() ); |
203 | ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent ); | 200 | ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent ); |