author | zecke <zecke> | 2002-10-19 02:32:30 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-19 02:32:30 (UTC) |
commit | 47ea36b68b6c7f12ae3bb777c89d813b4e1360a3 (patch) (side-by-side diff) | |
tree | d25ec05f1ccf0db36194d5f2879fe543a34620c2 /core/pim/todo/tableview.cpp | |
parent | 7871e87fbd796c57374b23ec91890962b2ef1fe9 (diff) | |
download | opie-47ea36b68b6c7f12ae3bb777c89d813b4e1360a3.zip opie-47ea36b68b6c7f12ae3bb777c89d813b4e1360a3.tar.gz opie-47ea36b68b6c7f12ae3bb777c89d813b4e1360a3.tar.bz2 |
Fix crash if todolist is empty
Fix paint update bugs.. knewly created items did not show
up. an sort() QTable::update() is and was not enough
A new feature. It's a quick entering method. It lacks icons and some
more stuff but I like it
Now redoing the Editor Dialog
-rw-r--r-- | core/pim/todo/tableview.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp index f4b898f..34b8b3c 100644 --- a/core/pim/todo/tableview.cpp +++ b/core/pim/todo/tableview.cpp @@ -126,8 +126,10 @@ void TableView::showOverDue( bool ) { } void TableView::updateView( ) { + qWarning("update view"); m_row = false; - startTimer( 2000 ); + static int id; + id = startTimer(2000 ); /* FIXME we want one page to be read! * * Calculate that screensize @@ -148,6 +150,8 @@ void TableView::updateView( ) { QTime t; t.start(); setNumRows( it.count() ); + if ( it.count() == 0 ) + killTimer(id); int elc = time.elapsed(); qWarning("Adding took %d", elc/1000 ); setUpdatesEnabled( true ); @@ -162,13 +166,12 @@ void TableView::setTodo( int, const OTodo&) { sort(); /* repaint */ - QTable::update(); + repaint(); } void TableView::addEvent( const OTodo&) { - sort(); /* fix problems of not showing the 'Haken' */ - QTable::repaint(); + updateView(); } /* * find the event @@ -428,6 +431,9 @@ void TableView::slotPriority() { * */ void TableView::timerEvent( QTimerEvent* ev ) { + if (sorted().count() == 0 ) + return; + int row = currentRow(); qWarning("TimerEvent %d", row); if ( m_row ) { |