summaryrefslogtreecommitdiff
path: root/core/pim/todo/tableview.cpp
authorzecke <zecke>2002-10-19 02:32:30 (UTC)
committer zecke <zecke>2002-10-19 02:32:30 (UTC)
commit47ea36b68b6c7f12ae3bb777c89d813b4e1360a3 (patch) (unidiff)
treed25ec05f1ccf0db36194d5f2879fe543a34620c2 /core/pim/todo/tableview.cpp
parent7871e87fbd796c57374b23ec91890962b2ef1fe9 (diff)
downloadopie-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
Diffstat (limited to 'core/pim/todo/tableview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/tableview.cpp14
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 ) {
126} 126}
127 127
128void TableView::updateView( ) { 128void TableView::updateView( ) {
129 qWarning("update view");
129 m_row = false; 130 m_row = false;
130 startTimer( 2000 ); 131 static int id;
132 id = startTimer(2000 );
131 /* FIXME we want one page to be read! 133 /* FIXME we want one page to be read!
132 * 134 *
133 * Calculate that screensize 135 * Calculate that screensize
@@ -148,6 +150,8 @@ void TableView::updateView( ) {
148 QTime t; 150 QTime t;
149 t.start(); 151 t.start();
150 setNumRows( it.count() ); 152 setNumRows( it.count() );
153 if ( it.count() == 0 )
154 killTimer(id);
151 int elc = time.elapsed(); 155 int elc = time.elapsed();
152 qWarning("Adding took %d", elc/1000 ); 156 qWarning("Adding took %d", elc/1000 );
153 setUpdatesEnabled( true ); 157 setUpdatesEnabled( true );
@@ -162,13 +166,12 @@ void TableView::setTodo( int, const OTodo&) {
162 sort(); 166 sort();
163 167
164 /* repaint */ 168 /* repaint */
165 QTable::update(); 169 repaint();
166} 170}
167void TableView::addEvent( const OTodo&) { 171void TableView::addEvent( const OTodo&) {
168 sort();
169 172
170 /* fix problems of not showing the 'Haken' */ 173 /* fix problems of not showing the 'Haken' */
171 QTable::repaint(); 174 updateView();
172} 175}
173/* 176/*
174 * find the event 177 * find the event
@@ -428,6 +431,9 @@ void TableView::slotPriority() {
428 * 431 *
429 */ 432 */
430void TableView::timerEvent( QTimerEvent* ev ) { 433void TableView::timerEvent( QTimerEvent* ev ) {
434 if (sorted().count() == 0 )
435 return;
436
431 int row = currentRow(); 437 int row = currentRow();
432 qWarning("TimerEvent %d", row); 438 qWarning("TimerEvent %d", row);
433 if ( m_row ) { 439 if ( m_row ) {