summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/todolist/todopluginwidget.cpp
Unidiff
Diffstat (limited to 'core/pim/today/plugins/todolist/todopluginwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/today/plugins/todolist/todopluginwidget.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp
index 320969e..773e5cf 100644
--- a/core/pim/today/plugins/todolist/todopluginwidget.cpp
+++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp
@@ -38,3 +38,5 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name )
38 } 38 }
39 todo = new ToDoDB(); 39
40 todo = new OTodoAccess();
41 todo->load();
40 42
@@ -69,3 +71,2 @@ void TodolistPluginWidget::getTodo() {
69 todoLabel = new OClickableLabel( this ); 71 todoLabel = new OClickableLabel( this );
70 todoLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
71 connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); 72 connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) );
@@ -78,10 +79,9 @@ void TodolistPluginWidget::getTodo() {
78 // get overdue todos first 79 // get overdue todos first
79 QValueList<ToDoEvent> overDueList = todo->overDue(); 80 m_list = todo->overDue();
80 qBubbleSort( overDueList ); 81
81 for ( QValueList<ToDoEvent>::Iterator it = overDueList.begin(); 82 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
82 it != overDueList.end(); ++it ) { 83 if (!(*m_it).isCompleted() && ( ammount < m_maxLinesTask ) ) {
83 if (!(*it).isCompleted() && ( ammount < m_maxLinesTask ) ) { 84 QString desc = (*m_it).summary();
84 QString desc = (*it).summary();
85 if( desc.isEmpty() ) { 85 if( desc.isEmpty() ) {
86 desc = (*it).description(); 86 desc = (*m_it).description();
87 } 87 }
@@ -93,7 +93,5 @@ void TodolistPluginWidget::getTodo() {
93 // get total number of still open todos 93 // get total number of still open todos
94 QValueList<ToDoEvent> openTodo = todo->rawToDos(); 94 m_list = todo->sorted( true, 1, 4, 1);
95 qBubbleSort( openTodo ); 95
96 for ( QValueList<ToDoEvent>::Iterator it = openTodo.begin(); 96 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
97 it != openTodo.end(); ++it ) {
98 if ( !(*it).isCompleted() ){
99 count +=1; 97 count +=1;
@@ -101,6 +99,6 @@ void TodolistPluginWidget::getTodo() {
101 // over the maxlines 99 // over the maxlines
102 if ( !(*it).isOverdue() && ( ammount < m_maxLinesTask ) ) { 100 if ( !(*m_it).isOverdue() && ( ammount < m_maxLinesTask ) ) {
103 QString desc = (*it).summary(); 101 QString desc = (*m_it).summary();
104 if( desc.isEmpty() ) { 102 if( desc.isEmpty() ) {
105 desc = (*it).description(); 103 desc = (*m_it).description();
106 } 104 }
@@ -110,4 +108,2 @@ void TodolistPluginWidget::getTodo() {
110 } 108 }
111 }
112
113 109