Diffstat (limited to 'core/pim/osearch/datebooksearch.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/datebooksearch.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp index 85c55c2..e60a3b1 100644 --- a/core/pim/osearch/datebooksearch.cpp +++ b/core/pim/osearch/datebooksearch.cpp | |||
@@ -16,44 +16,48 @@ | |||
16 | 16 | ||
17 | #include <opie/oevent.h> | 17 | #include <opie/oevent.h> |
18 | #include <opie/odatebookaccess.h> | 18 | #include <opie/odatebookaccess.h> |
19 | 19 | ||
20 | DatebookSearch::DatebookSearch(QListView* parent, QString name) | 20 | DatebookSearch::DatebookSearch(QListView* parent, QString name) |
21 | : SearchGroup(parent, name) | 21 | : SearchGroup(parent, name) |
22 | { | 22 | { |
23 | _dates = 0; | 23 | _dates = 0; |
24 | } | 24 | } |
25 | 25 | ||
26 | 26 | ||
27 | DatebookSearch::~DatebookSearch() | 27 | DatebookSearch::~DatebookSearch() |
28 | { | 28 | { |
29 | delete _dates; | 29 | delete _dates; |
30 | } | 30 | } |
31 | 31 | ||
32 | 32 | ||
33 | void DatebookSearch::expand() | 33 | void DatebookSearch::expand() |
34 | { | 34 | { |
35 | SearchGroup::expand(); | 35 | SearchGroup::expand(); |
36 | if (!_dates){ | 36 | if (!_dates){ |
37 | _dates = new ODateBookAccess(); | 37 | _dates = new ODateBookAccess(); |
38 | _dates->load(); | 38 | _dates->load(); |
39 | } | 39 | } |
40 | 40 | #define LIPBOPIE_SEARCH | |
41 | #ifdef LIPBOPIE_SEARCH | ||
42 | ORecordList<OEvent> results = _dates->matchRegexp(_search); | ||
43 | for (uint i = 0; i < results.count(); i++) { | ||
44 | new EventItem( this, new OEvent( results[i] )); | ||
45 | } | ||
46 | #else | ||
41 | ORecordList<OEvent> list = _dates->allRecords(); | 47 | ORecordList<OEvent> list = _dates->allRecords(); |
42 | QArray<int> m_currentQuery( list.count() ); | 48 | QArray<int> m_currentQuery( list.count() ); |
43 | for( uint i=0; i<list.count(); i++ ){ | 49 | for( uint i=0; i<list.count(); i++ ){ |
44 | 50 | //qDebug("datebook: %s",list[i].description().latin1() ); | |
45 | if ( | 51 | if ( |
46 | ( list[i].description().contains( _search ) ) || | 52 | ( list[i].description().contains( _search ) ) || |
47 | ( list[i].note().contains( _search ) ) || | 53 | ( list[i].note().contains( _search ) ) || |
48 | ( list[i].location().contains( _search ) ) | 54 | ( list[i].location().contains( _search ) ) |
49 | // ( _search.find( list[i].description(), 0 ) > 0 ) || | ||
50 | // ( _search.find( list[i].note(), 0 ) > 0 ) || | ||
51 | // ( _search.find( list[i].location(), 0 ) > 0 ) | ||
52 | ){ | 55 | ){ |
56 | //qDebug("FOUND"); | ||
53 | new EventItem( this, new OEvent( list[i] ) ); | 57 | new EventItem( this, new OEvent( list[i] ) ); |
54 | // new OListViewItem( this, list[i].description() ); | ||
55 | } | 58 | } |
56 | 59 | ||
57 | } | 60 | } |
61 | #endif | ||
58 | } | 62 | } |
59 | 63 | ||