summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp32
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
@@ -225,8 +225,6 @@ void MainWindow::initViews() {
225 m_views.append( tableView ); 225 m_views.append( tableView );
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
232 * and subdirs for multiple views 230 * and subdirs for multiple views
@@ -276,11 +274,29 @@ QPopupMenu* MainWindow::view() {
276QToolBar* MainWindow::toolbar() { 274QToolBar* MainWindow::toolbar() {
277 return m_tool; 275 return m_tool;
278} 276}
279OTodoAccess::List::Iterator MainWindow::begin() { 277OTodoAccess::List MainWindow::list()const {
280 return m_todoMgr.begin(); 278 return m_todoMgr.list();
279}
280OTodoAccess::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}
282OTodoAccess::List::Iterator MainWindow::end() { 294OTodoAccess::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}
285OTodo MainWindow::event( int uid ) { 301OTodo MainWindow::event( int uid ) {
286 return m_todoMgr.event( uid ); 302 return m_todoMgr.event( uid );
@@ -299,7 +315,7 @@ TodoShow* MainWindow::currentShow() {
299} 315}
300void MainWindow::slotReload() { 316void MainWindow::slotReload() {
301 m_todoMgr.reload(); 317 m_todoMgr.reload();
302 currentView()->setTodos( begin(), end() ); 318 currentView()->updateView( );
303 raiseCurrentView(); 319 raiseCurrentView();
304} 320}
305void MainWindow::closeEvent( QCloseEvent* e ) { 321void MainWindow::closeEvent( QCloseEvent* e ) {
@@ -466,7 +482,7 @@ void MainWindow::slotDeleteCompleted() {
466 return; 482 return;
467 483
468 m_todoMgr.remove( currentView()->completed() ); 484 m_todoMgr.remove( currentView()->completed() );
469 currentView()->setTodos( begin(), end() ); 485 currentView()->updateView( );
470} 486}
471void MainWindow::slotFind() { 487void MainWindow::slotFind() {
472 488