summaryrefslogtreecommitdiff
path: root/core/pim/todo/tableview.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/tableview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/tableview.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp
index d980a24..5bbf880 100644
--- a/core/pim/todo/tableview.cpp
+++ b/core/pim/todo/tableview.cpp
@@ -34,13 +34,13 @@
34#include <qtimer.h> 34#include <qtimer.h>
35#include <qpopupmenu.h> 35#include <qpopupmenu.h>
36 36
37#include <qpe/config.h> 37#include <qpe/config.h>
38#include <qpe/resource.h> 38#include <qpe/resource.h>
39 39
40#include <opie/orecur.h> 40#include <opie2/opimrecurrence.h>
41 41
42#include "mainwindow.h" 42#include "mainwindow.h"
43//#include "tableitems.h" 43//#include "tableitems.h"
44#include "tableview.h" 44#include "tableview.h"
45 45
46using namespace Todo; 46using namespace Todo;
@@ -181,13 +181,13 @@ int TableView::prev() {
181 if ( currentRow() - 1 < 0 ) return 0; 181 if ( currentRow() - 1 < 0 ) return 0;
182 setCurrentCell( currentRow() -1, currentColumn() ); 182 setCurrentCell( currentRow() -1, currentColumn() );
183 return sorted().uidAt( currentRow() ); 183 return sorted().uidAt( currentRow() );
184 184
185} 185}
186QString TableView::currentRepresentation() { 186QString TableView::currentRepresentation() {
187 OTodo to = sorted()[currentRow()]; 187 OPimTodo to = sorted()[currentRow()];
188 return to.summary().isEmpty() ? to.description().left(20) : to.summary() ; 188 return to.summary().isEmpty() ? to.description().left(20) : to.summary() ;
189} 189}
190/* show overdue */ 190/* show overdue */
191void TableView::showOverDue( bool ) { 191void TableView::showOverDue( bool ) {
192 clear(); 192 clear();
193 updateView(); 193 updateView();
@@ -201,13 +201,13 @@ void TableView::updateView( ) {
201 /* FIXME we want one page to be read! 201 /* FIXME we want one page to be read!
202 * 202 *
203 * Calculate that screensize 203 * Calculate that screensize
204 */ 204 */
205 todoWindow()->setReadAhead( 4 ); 205 todoWindow()->setReadAhead( 4 );
206 sort(); 206 sort();
207 OTodoAccess::List::Iterator it, end; 207 OPimTodoAccess::List::Iterator it, end;
208 it = sorted().begin(); 208 it = sorted().begin();
209 end = sorted().end(); 209 end = sorted().end();
210 210
211 qWarning("setTodos"); 211 qWarning("setTodos");
212 QTime time; 212 QTime time;
213 time.start(); 213 time.start();
@@ -224,28 +224,28 @@ void TableView::updateView( ) {
224 viewport()->setUpdatesEnabled( true ); 224 viewport()->setUpdatesEnabled( true );
225 viewport()->update(); 225 viewport()->update();
226 226
227 m_enablePaint = true; 227 m_enablePaint = true;
228// int el = time.elapsed(); 228// int el = time.elapsed();
229} 229}
230void TableView::setTodo( int, const OTodo&) { 230void TableView::setTodo( int, const OPimTodo&) {
231 sort(); 231 sort();
232 232
233 /* repaint */ 233 /* repaint */
234 repaint(); 234 repaint();
235} 235}
236void TableView::addEvent( const OTodo&) { 236void TableView::addEvent( const OPimTodo&) {
237 237
238 /* fix problems of not showing the 'Haken' */ 238 /* fix problems of not showing the 'Haken' */
239 updateView(); 239 updateView();
240} 240}
241/* 241/*
242 * find the event 242 * find the event
243 * and then replace the complete row 243 * and then replace the complete row
244 */ 244 */
245void TableView::replaceEvent( const OTodo& ev) { 245void TableView::replaceEvent( const OPimTodo& ev) {
246 addEvent( ev ); 246 addEvent( ev );
247} 247}
248/* 248/*
249 * re aligning table can be slow too 249 * re aligning table can be slow too
250 * FIXME: look what performs better 250 * FIXME: look what performs better
251 * either this or the old align table 251 * either this or the old align table
@@ -385,13 +385,13 @@ void TableView::viewportPaintEvent( QPaintEvent* e) {
385 */ 385 */
386void TableView::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) { 386void TableView::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) {
387 const QColorGroup &cg = colorGroup(); 387 const QColorGroup &cg = colorGroup();
388 388
389 p->save(); 389 p->save();
390 390
391 OTodo task = sorted()[row]; 391 OPimTodo task = sorted()[row];
392 392
393 // TODO - give user option for grid or bars? 393 // TODO - give user option for grid or bars?
394 394
395 // Paint alternating background bars 395 // Paint alternating background bars
396 if ( (row % 2 ) == 0 ) { 396 if ( (row % 2 ) == 0 ) {
397 p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) ); 397 p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) );
@@ -494,24 +494,24 @@ QWidget* TableView::createEditor(int row, int col, bool )const {
494void TableView::setCellContentFromEditor(int row, int col ) { 494void TableView::setCellContentFromEditor(int row, int col ) {
495 qWarning("set cell content from editor"); 495 qWarning("set cell content from editor");
496 if ( col == 1 ) { 496 if ( col == 1 ) {
497 QWidget* wid = cellWidget(row, 1 ); 497 QWidget* wid = cellWidget(row, 1 );
498 if ( wid->inherits("QComboBox") ) { 498 if ( wid->inherits("QComboBox") ) {
499 int pri = ((QComboBox*)wid)->currentItem() + 1; 499 int pri = ((QComboBox*)wid)->currentItem() + 1;
500 OTodo todo = sorted()[row]; 500 OPimTodo todo = sorted()[row];
501 if ( todo.priority() != pri ) { 501 if ( todo.priority() != pri ) {
502 todo.setPriority( pri ); 502 todo.setPriority( pri );
503 TodoView::update( todo.uid(), todo ); 503 TodoView::update( todo.uid(), todo );
504 updateView(); 504 updateView();
505 } 505 }
506 } 506 }
507 }else if ( col == 2) { 507 }else if ( col == 2) {
508 QWidget* wid = cellWidget(row, 2); 508 QWidget* wid = cellWidget(row, 2);
509 if ( wid->inherits("QLineEdit") ) { 509 if ( wid->inherits("QLineEdit") ) {
510 QString text = ((QLineEdit*)wid)->text(); 510 QString text = ((QLineEdit*)wid)->text();
511 OTodo todo = sorted()[row]; 511 OPimTodo todo = sorted()[row];
512 if ( todo.summary() != text ) { 512 if ( todo.summary() != text ) {
513 todo.setSummary( text ); 513 todo.setSummary( text );
514 TodoView::update( todo.uid(), todo ); 514 TodoView::update( todo.uid(), todo );
515 updateView(); 515 updateView();
516 } 516 }
517 } 517 }