summaryrefslogtreecommitdiff
path: root/core/pim/todo/tableview.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/tableview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/tableview.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp
index 097af39..eaaf1bc 100644
--- a/core/pim/todo/tableview.cpp
+++ b/core/pim/todo/tableview.cpp
@@ -121,51 +121,54 @@ void TableView::updateFromTable( const OTodo& ev, CheckItem* item ) {
DueTextItem *due = dueItem( item->row() );
due->setCompleted( ev.isCompleted() );
}
QString TableView::type() const {
return QString::fromLatin1( tr("Table View") );
}
int TableView::current() {
int cur = 0;
CheckItem* i = checkItem( currentRow() );
if (i )
cur = i->uid();
return cur;
}
QString TableView::currentRepresentation() {
return text( currentRow(), 2);
}
/* show overdue */
void TableView::showOverDue( bool ) {
clear();
updateView();
}
void TableView::updateView( ) {
+ setSortOrder( 0 );
+ setAscending( true );
+ sort();
OTodoAccess::List::Iterator it, end;
- it = list().begin();
- end = list().end();
+ it = sorted().begin();
+ end = sorted().end();
qWarning("setTodos");
QTime time;
time.start();
m_enablePaint = false;
setUpdatesEnabled( false );
viewport()->setUpdatesEnabled( false );
clear();
QString currentCat = todoWindow()->currentCategory();
bool showCompleted = todoWindow()->showCompleted();
bool showOverDue = todoWindow()->showOverDue();
qWarning( "Current Category:" + todoWindow()->currentCategory() );
int id = todoWindow()->currentCatId();
QTime t;
t.start();
setNumRows( it.count() );
uint i = 0;
for (; it != end; ++it ) {
OTodo todo = (*it);
/* test if the categories match */
if ( !currentCat.isEmpty() &&
!todo.categories().contains( id ) ) {
continue;
}
/* the item is completed but we shouldn't show it */