Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index a8f4c9c..47c0160 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp @@ -227,4 +227,2 @@ void MainWindow::initViews() { connectBase( tableView ); -// tableView->setTodos( begin(), end() ); we call populateCategories - /* add QString type + QString configname to @@ -278,7 +276,25 @@ QToolBar* MainWindow::toolbar() { } -OTodoAccess::List::Iterator MainWindow::begin() { - return m_todoMgr.begin(); +OTodoAccess::List MainWindow::list()const { + return m_todoMgr.list(); +} +OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { + int cat = 0; + if ( m_curCat == tr("All Categories") ) + cat = currentCatId(); + + int filter = 1; + + if (!m_completed ) + filter |= 4; + if (m_overdue) + filter |= 2; + + return m_todoMgr.sorted( asc, sortOrder, filter, cat ); } -OTodoAccess::List::Iterator MainWindow::end() { - return m_todoMgr.end(); +OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { + int cat = 0; + if ( m_curCat == tr("All Categories") ) + cat = currentCatId(); + + return m_todoMgr.sorted(asc, sortOrder, addFilter, cat ); } @@ -301,3 +317,3 @@ void MainWindow::slotReload() { m_todoMgr.reload(); - currentView()->setTodos( begin(), end() ); + currentView()->updateView( ); raiseCurrentView(); @@ -468,3 +484,3 @@ void MainWindow::slotDeleteCompleted() { m_todoMgr.remove( currentView()->completed() ); - currentView()->setTodos( begin(), end() ); + currentView()->updateView( ); } |