summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todotable.cpp22
-rw-r--r--core/pim/todo/todotable.h3
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 )
showDeadl( true)
{
+ setNumRows(0);
mCat.load( categoryFileName() );
setSorting( TRUE );
@@ -247,5 +248,5 @@ TodoTable::TodoTable( QWidget *parent, const char *name )
setColumnStretchable( 3, FALSE );
setColumnWidth( 3, 20 );
- horizontalHeader()->setLabel( 3, tr( "Deadline" ) );
+ horizontalHeader()->setLabel( 3, tr( "Deadline" ) );
if (showDeadl){
@@ -314,5 +315,5 @@ void TodoTable::slotClicked( int row, int col, int, const QPoint &pos )
}
break;
- case 3:
+ case 3:
// may as well edit it...
menuTimer->stop();
@@ -439,5 +440,5 @@ void TodoTable::updateVisible()
if ( !isUpdatesEnabled() )
return;
-
+
if (showDeadl){
showColumn (3);
@@ -453,4 +454,7 @@ void TodoTable::updateVisible()
CheckItem *ci = (CheckItem *)item( row, 0 );
ToDoEvent *t = todoList[ci];
+ if (!t)
+ continue;
+
QArray<int> vlCats = t->categories();
bool hide = false;
@@ -600,5 +604,5 @@ void TodoTable::loadFile( const QString &/*we use the standard*/ )
ToDoEvent *event = new ToDoEvent( (*it) );
list.append( event );
- }
+ }
vaList.clear();
// qDebug("parsing done=%d", t.elapsed() );
@@ -682,5 +686,5 @@ void TodoTable::keyPressEvent( QKeyEvent *e )
default:
break;
- }
+ }
} else
QTable::keyPressEvent( e );
@@ -759,5 +763,5 @@ int TodoTable::showCategoryId() const
return id;
}
-void TodoTable::applyJournal()
+void TodoTable::applyJournal()
{
// we need to hack
@@ -810,5 +814,5 @@ void TodoTable::slotCheckDay()
setPaintingEnabled( FALSE );
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 );
@@ -919,6 +923,6 @@ static ToDoEvent xmlToEvent( XMLElement *element )
dummy = element->attribute("Categories" );
QStringList ids = QStringList::split(";", dummy );
- event.setCategories( ids );
-
+ event.setCategories( ids );
+
//uid
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:
inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row )
{
- int rows = numRows();
- ++rows;
- setNumRows( rows );
QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A')
+ todo->priority() )