summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/tableview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp
index 39f0d72..8cd2e7e 100644
--- a/core/pim/todo/tableview.cpp
+++ b/core/pim/todo/tableview.cpp
@@ -130,65 +130,66 @@ int TableView::current() {
130 if (i ) 130 if (i )
131 cur = i->uid(); 131 cur = i->uid();
132 132
133 return cur; 133 return cur;
134} 134}
135QString TableView::currentRepresentation() { 135QString TableView::currentRepresentation() {
136 return text( currentRow(), 2); 136 return text( currentRow(), 2);
137} 137}
138/* show overdue */ 138/* show overdue */
139void TableView::showOverDue( bool ) { 139void TableView::showOverDue( bool ) {
140 clear(); 140 clear();
141 setTodos( begin(), end() ); 141 setTodos( begin(), end() );
142} 142}
143 143
144void TableView::setTodos( OTodoAccess::List::Iterator it, 144void TableView::setTodos( OTodoAccess::List::Iterator it,
145 OTodoAccess::List::Iterator end ) { 145 OTodoAccess::List::Iterator end ) {
146 qWarning("setTodos"); 146 qWarning("setTodos");
147 QTime time; 147 QTime time;
148 time.start(); 148 time.start();
149 m_enablePaint = false; 149 m_enablePaint = false;
150 setUpdatesEnabled( false ); 150 setUpdatesEnabled( false );
151 viewport()->setUpdatesEnabled( false ); 151 viewport()->setUpdatesEnabled( false );
152 clear(); 152 clear();
153 QString currentCat = todoWindow()->currentCategory(); 153 QString currentCat = todoWindow()->currentCategory();
154 bool showCompleted = todoWindow()->currentCatId(); 154 bool showCompleted = todoWindow()->showCompleted();
155 bool showOverDue = todoWindow()->showOverDue(); 155 bool showOverDue = todoWindow()->showOverDue();
156 qWarning( "Current Category:" + todoWindow()->currentCategory() ); 156 qWarning( "Current Category:" + todoWindow()->currentCategory() );
157 int id = todoWindow()->currentCatId(); 157 int id = todoWindow()->currentCatId();
158 QTime t; 158 QTime t;
159 t.start(); 159 t.start();
160 setNumRows( it.count() ); 160 setNumRows( it.count() );
161 uint i = 0; 161 uint i = 0;
162 for (; it != end; ++it ) { 162 for (; it != end; ++it ) {
163 OTodo todo = (*it); 163 OTodo todo = (*it);
164 /* test if the categories match */ 164 /* test if the categories match */
165 if ( !currentCat.isEmpty() && 165 if ( !currentCat.isEmpty() &&
166 !todo.categories().contains( id ) ) { 166 !todo.categories().contains( id ) ) {
167 continue; 167 continue;
168 } 168 }
169 /* the item is completed but we shouldn't show it */ 169 /* the item is completed but we shouldn't show it */
170 if ( !showCompleted && todo.isCompleted() ) { 170 if ( !showCompleted && todo.isCompleted() ) {
171 qWarning("isCompleted ");
171 continue; 172 continue;
172 } 173 }
173 /* the item is not overdue but we should only show overdue */ 174 /* the item is not overdue but we should only show overdue */
174 if ( showOverDue && !todo.isOverdue() ) { 175 if ( showOverDue && !todo.isOverdue() ) {
175 continue; 176 continue;
176 } 177 }
177 /* now it's fine to add it */ 178 /* now it's fine to add it */
178 insertTodo( todo, i ); 179 insertTodo( todo, i );
179 i++; 180 i++;
180 } 181 }
181 setNumRows( i ); 182 setNumRows( i );
182 int elc = time.elapsed(); 183 int elc = time.elapsed();
183 qWarning("Adding took %d", elc/1000 ); 184 qWarning("Adding took %d", elc/1000 );
184 setUpdatesEnabled( true ); 185 setUpdatesEnabled( true );
185 viewport()->setUpdatesEnabled( true ); 186 viewport()->setUpdatesEnabled( true );
186 viewport()->update(); 187 viewport()->update();
187 m_enablePaint = true; 188 m_enablePaint = true;
188 int el = time.elapsed(); 189 int el = time.elapsed();
189 qWarning("adding took %d", el/1000 ); 190 qWarning("adding took %d", el/1000 );
190} 191}
191void TableView::setTodo( int uid, const OTodo& ev ) { 192void TableView::setTodo( int uid, const OTodo& ev ) {
192 QMap<int, CheckItem*>::Iterator it = m_cache.find( uid ); 193 QMap<int, CheckItem*>::Iterator it = m_cache.find( uid );
193 194
194 if ( it != m_cache.end() ) { 195 if ( it != m_cache.end() ) {