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.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp
index fba8aa0..cbe356b 100644
--- a/core/pim/osearch/todosearch.cpp
+++ b/core/pim/osearch/todosearch.cpp
@@ -5,62 +5,47 @@
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "todosearch.h" 13#include "todosearch.h"
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>
18 17
19#include "todoitem.h" 18#include "todoitem.h"
20 19
21TodoSearch::TodoSearch(QListView* parent, QString name) 20TodoSearch::TodoSearch(QListView* parent, QString name)
22: SearchGroup(parent, name) 21: SearchGroup(parent, name)
23{ 22{
24 //_fileName = QDir::homeDirPath()+"/Applications/todolist/todolist.xml";
25 _todos = 0; 23 _todos = 0;
26} 24}
27 25
28 26
29TodoSearch::~TodoSearch() 27TodoSearch::~TodoSearch()
30{ 28{
31 delete _todos; 29 delete _todos;
32} 30}
33 31
34 32
35void TodoSearch::expand() 33void TodoSearch::expand()
36{ 34{
37 SearchGroup::expand(); 35 SearchGroup::expand();
38 if (_search.isEmpty()) return; 36 if (_search.isEmpty()) return;
39 37
40 if (!_todos){ 38 if (!_todos){
41 _todos = new OTodoAccess(); 39 _todos = new OTodoAccess();
42 _todos->load(); 40 _todos->load();
43 } 41 }
44 42
45#ifdef LIPBOPIE_SEARCH
46 ORecordList<OTodo> results = _todos->matchRegexp(_search); 43 ORecordList<OTodo> results = _todos->matchRegexp(_search);
47 setText(0, text(0) + " (" + QString::number( results.count() ) + ")"); 44 setText(0, text(0) + " (" + QString::number( results.count() ) + ")");
48 for (uint i = 0; i < results.count(); i++) { 45 for (uint i = 0; i < results.count(); i++) {
49 new TodoItem( this, new OTodo( results[i] )); 46 new TodoItem( this, new OTodo( results[i] ));
50 } 47 }
51#else
52 ORecordList<OTodo> list = _todos->allRecords();
53 QArray<int> m_currentQuery( list.count() );
54 for( uint i=0; i<list.count(); i++ ){
55 // qDebug("todo: %s",list[i].summary().latin1() );
56 if ( list[i].match( _search ) ){
57 // qDebug("FOUND");
58 new TodoItem( this, new OTodo( list[i] ) );
59 }
60
61 }
62#endif
63 48
64} 49}
65 50
66 51