-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 | |||
@@ -232,4 +232,5 @@ TodoTable::TodoTable( QWidget *parent, const char *name ) | |||
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 ); |
@@ -247,5 +248,5 @@ TodoTable::TodoTable( QWidget *parent, const char *name ) | |||
247 | setColumnStretchable( 3, FALSE ); | 248 | setColumnStretchable( 3, FALSE ); |
248 | setColumnWidth( 3, 20 ); | 249 | setColumnWidth( 3, 20 ); |
249 | horizontalHeader()->setLabel( 3, tr( "Deadline" ) ); | 250 | horizontalHeader()->setLabel( 3, tr( "Deadline" ) ); |
250 | 251 | ||
251 | if (showDeadl){ | 252 | if (showDeadl){ |
@@ -314,5 +315,5 @@ void TodoTable::slotClicked( int row, int col, int, const QPoint &pos ) | |||
314 | } | 315 | } |
315 | break; | 316 | break; |
316 | case 3: | 317 | case 3: |
317 | // may as well edit it... | 318 | // may as well edit it... |
318 | menuTimer->stop(); | 319 | menuTimer->stop(); |
@@ -439,5 +440,5 @@ void TodoTable::updateVisible() | |||
439 | if ( !isUpdatesEnabled() ) | 440 | if ( !isUpdatesEnabled() ) |
440 | return; | 441 | return; |
441 | 442 | ||
442 | if (showDeadl){ | 443 | if (showDeadl){ |
443 | showColumn (3); | 444 | showColumn (3); |
@@ -453,4 +454,7 @@ void TodoTable::updateVisible() | |||
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; |
@@ -600,5 +604,5 @@ void TodoTable::loadFile( const QString &/*we use the standard*/ ) | |||
600 | ToDoEvent *event = new ToDoEvent( (*it) ); | 604 | ToDoEvent *event = new ToDoEvent( (*it) ); |
601 | list.append( event ); | 605 | list.append( event ); |
602 | } | 606 | } |
603 | vaList.clear(); | 607 | vaList.clear(); |
604 | // qDebug("parsing done=%d", t.elapsed() ); | 608 | // qDebug("parsing done=%d", t.elapsed() ); |
@@ -682,5 +686,5 @@ void TodoTable::keyPressEvent( QKeyEvent *e ) | |||
682 | default: | 686 | default: |
683 | break; | 687 | break; |
684 | } | 688 | } |
685 | } else | 689 | } else |
686 | QTable::keyPressEvent( e ); | 690 | QTable::keyPressEvent( e ); |
@@ -759,5 +763,5 @@ int TodoTable::showCategoryId() const | |||
759 | return id; | 763 | return id; |
760 | } | 764 | } |
761 | void TodoTable::applyJournal() | 765 | void TodoTable::applyJournal() |
762 | { | 766 | { |
763 | // we need to hack | 767 | // we need to hack |
@@ -810,5 +814,5 @@ void TodoTable::slotCheckDay() | |||
810 | setPaintingEnabled( FALSE ); | 814 | setPaintingEnabled( FALSE ); |
811 | for(int i=0; i < numRows(); i++ ){ | 815 | for(int i=0; i < numRows(); i++ ){ |
812 | ToDoEvent *t = todoList[static_cast<CheckItem*>(item(i, 0))]; | 816 | ToDoEvent *t = todoList[static_cast<CheckItem*>(item(i, 0))]; |
813 | static_cast<DueTextItem*>(item(i, 3) )->setToDoEvent( t ); | 817 | static_cast<DueTextItem*>(item(i, 3) )->setToDoEvent( t ); |
814 | 818 | ||
@@ -919,6 +923,6 @@ static ToDoEvent xmlToEvent( XMLElement *element ) | |||
919 | dummy = element->attribute("Categories" ); | 923 | dummy = element->attribute("Categories" ); |
920 | QStringList ids = QStringList::split(";", dummy ); | 924 | QStringList ids = QStringList::split(";", dummy ); |
921 | event.setCategories( ids ); | 925 | event.setCategories( ids ); |
922 | 926 | ||
923 | //uid | 927 | //uid |
924 | dummy = element->attribute("Uid" ); | 928 | dummy = element->attribute("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 | |||
@@ -193,7 +193,4 @@ private: | |||
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() ) |