-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 | |||
@@ -226,6 +226,4 @@ void MainWindow::initViews() { | |||
226 | m_curView = tableView; | 226 | m_curView = tableView; |
227 | connectBase( tableView ); | 227 | connectBase( tableView ); |
228 | // tableView->setTodos( begin(), end() ); we call populateCategories | ||
229 | |||
230 | /* add QString type + QString configname to | 228 | /* add QString type + QString configname to |
231 | * the View menu | 229 | * the View menu |
@@ -277,9 +275,27 @@ QToolBar* MainWindow::toolbar() { | |||
277 | return m_tool; | 275 | return m_tool; |
278 | } | 276 | } |
279 | OTodoAccess::List::Iterator MainWindow::begin() { | 277 | OTodoAccess::List MainWindow::list()const { |
280 | return m_todoMgr.begin(); | 278 | return m_todoMgr.list(); |
279 | } | ||
280 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { | ||
281 | int cat = 0; | ||
282 | if ( m_curCat == tr("All Categories") ) | ||
283 | cat = currentCatId(); | ||
284 | |||
285 | int filter = 1; | ||
286 | |||
287 | if (!m_completed ) | ||
288 | filter |= 4; | ||
289 | if (m_overdue) | ||
290 | filter |= 2; | ||
291 | |||
292 | return m_todoMgr.sorted( asc, sortOrder, filter, cat ); | ||
281 | } | 293 | } |
282 | OTodoAccess::List::Iterator MainWindow::end() { | 294 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { |
283 | return m_todoMgr.end(); | 295 | int cat = 0; |
296 | if ( m_curCat == tr("All Categories") ) | ||
297 | cat = currentCatId(); | ||
298 | |||
299 | return m_todoMgr.sorted(asc, sortOrder, addFilter, cat ); | ||
284 | } | 300 | } |
285 | OTodo MainWindow::event( int uid ) { | 301 | OTodo MainWindow::event( int uid ) { |
@@ -300,5 +316,5 @@ TodoShow* MainWindow::currentShow() { | |||
300 | void MainWindow::slotReload() { | 316 | void MainWindow::slotReload() { |
301 | m_todoMgr.reload(); | 317 | m_todoMgr.reload(); |
302 | currentView()->setTodos( begin(), end() ); | 318 | currentView()->updateView( ); |
303 | raiseCurrentView(); | 319 | raiseCurrentView(); |
304 | } | 320 | } |
@@ -467,5 +483,5 @@ void MainWindow::slotDeleteCompleted() { | |||
467 | 483 | ||
468 | m_todoMgr.remove( currentView()->completed() ); | 484 | m_todoMgr.remove( currentView()->completed() ); |
469 | currentView()->setTodos( begin(), end() ); | 485 | currentView()->updateView( ); |
470 | } | 486 | } |
471 | void MainWindow::slotFind() { | 487 | void MainWindow::slotFind() { |