Diffstat (limited to 'core/pim/osearch/todosearch.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/todosearch.cpp | 14 |
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 | |||
@@ -32,22 +32,32 @@ TodoSearch::~TodoSearch() | |||
32 | } | 32 | } |
33 | 33 | ||
34 | 34 | ||
35 | void TodoSearch::expand() | 35 | void 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 | ||