summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/todo/todotable.cpp4
-rw-r--r--core/pim/todo/todotable.h3
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
@@ -222,24 +222,25 @@ void DueTextItem::paint( QPainter *p, const QColorGroup &cg, const QRect &cr, bo
TodoTable::TodoTable( QWidget *parent, const char *name )
// #ifdef QT_QTABLE_NOHEADER_CONSTRUCTOR
// : QTable( 0, 3, parent, name, TRUE ),
// #else
: QTable( 0, 4, parent, name ),
// #endif
showComp( true ),
enablePainting( true ),
mCat( 0 ),
currFindRow( -2 ),
showDeadl( true)
{
+ setNumRows(0);
mCat.load( categoryFileName() );
setSorting( TRUE );
setSelectionMode( NoSelection );
setColumnStretchable( 2, TRUE );
setColumnWidth( 0, 20 );
setColumnWidth( 1, 35 );
setLeftMargin( 0 );
verticalHeader()->hide();
horizontalHeader()->setLabel( 0, tr( "C." ) );
horizontalHeader()->setLabel( 1, tr( "Prior." ) );
horizontalHeader()->setLabel( 2, tr( "Description" ) );
@@ -443,24 +444,27 @@ void TodoTable::updateVisible()
showColumn (3);
adjustColumn(3);
}else{
hideColumn (3);
adjustColumn(2);
}
int visible = 0;
int id = mCat.id( "Todo List", showCat );
for ( int row = 0; row < numRows(); row++ ) {
CheckItem *ci = (CheckItem *)item( row, 0 );
ToDoEvent *t = todoList[ci];
+ if (!t)
+ continue;
+
QArray<int> vlCats = t->categories();
bool hide = false;
if ( !showComp && ci->isChecked() )
hide = true;
if ( !showCat.isEmpty() ) {
if ( showCat == tr( "Unfiled" ) ) {
if ( vlCats.count() > 0 )
hide = true;
} else {
// do some comparing, we have to reverse our idea here... which idea? - zecke
if ( !hide ) {
hide = true;
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
@@ -183,27 +183,24 @@ private:
QTimer *menuTimer;
QDate mDay;
QTimer *mDayTimer; // see if the day changed
bool enablePainting;
Categories mCat;
int currFindRow;
bool showDeadl:1;
};
inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row )
{
- int rows = numRows();
- ++rows;
- setNumRows( rows );
QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A')
+ todo->priority() )
+ Qtopia::buildSortKey( todo->description() );
CheckItem *chk = new CheckItem( this, sortKey );
chk->setChecked( todo->isCompleted() );
ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent );
cmb->setText( QString::number( todo->priority() ) );
QString sum = todo->summary();
QTableItem *ti = new TodoTextItem( this, sum.isEmpty() ? todo->description().left(40).simplifyWhiteSpace() : sum );
ti->setReplaceable( false );
DueTextItem *due = new DueTextItem(this, todo );