summaryrefslogtreecommitdiff
path: root/core/pim/osearch/todosearch.cpp
Unidiff
Diffstat (limited to 'core/pim/osearch/todosearch.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/todosearch.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp
index e34c384..82fae8d 100644
--- a/core/pim/osearch/todosearch.cpp
+++ b/core/pim/osearch/todosearch.cpp
@@ -14,40 +14,50 @@
14 14
15#include <opie/otodoaccess.h> 15#include <opie/otodoaccess.h>
16#include <opie/otodo.h> 16#include <opie/otodo.h>
17#include <qdir.h> 17#include <qdir.h>
18 18
19#include "todoitem.h" 19#include "todoitem.h"
20 20
21TodoSearch::TodoSearch(QListView* parent, QString name) 21TodoSearch::TodoSearch(QListView* parent, QString name)
22: SearchGroup(parent, name) 22: SearchGroup(parent, name)
23{ 23{
24 //_fileName = QDir::homeDirPath()+"/Applications/todolist/todolist.xml"; 24 //_fileName = QDir::homeDirPath()+"/Applications/todolist/todolist.xml";
25 _todos = 0; 25 _todos = 0;
26} 26}
27 27
28 28
29TodoSearch::~TodoSearch() 29TodoSearch::~TodoSearch()
30{ 30{
31 delete _todos; 31 delete _todos;
32} 32}
33 33
34 34
35void TodoSearch::expand() 35void TodoSearch::expand()
36{ 36{
37 SearchGroup::expand(); 37 SearchGroup::expand();
38 if (!_todos){ 38 if (_search.isEmpty()) return;
39
40 if (!_todos){
39 _todos = new OTodoAccess(); 41 _todos = new OTodoAccess();
40 _todos->load(); 42 _todos->load();
41 } 43 }
44
45 ORecordList<OTodo> results = _todos->matchRegexp(_search);
46 for (uint i = 0; i < results.count(); i++) {
47 new TodoItem( this, new OTodo( results[i] ));
48 }
49/*
42 ORecordList<OTodo> list = _todos->allRecords(); 50 ORecordList<OTodo> list = _todos->allRecords();
43 QArray<int> m_currentQuery( list.count() ); 51 QArray<int> m_currentQuery( list.count() );
44 for( uint i=0; i<list.count(); i++ ){ 52 for( uint i=0; i<list.count(); i++ ){
53 // qDebug("todo: %s",list[i].summary().latin1() );
45 if ( list[i].match( _search ) ){ 54 if ( list[i].match( _search ) ){
55 // qDebug("FOUND");
46 new TodoItem( this, new OTodo( list[i] ) ); 56 new TodoItem( this, new OTodo( list[i] ) );
47 } 57 }
48 58
49 } 59 }*/
50 60
51} 61}
52 62
53 63