Diffstat (limited to 'core/pim/osearch/datebooksearch.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/datebooksearch.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp index 8f9d472..0590252 100644 --- a/core/pim/osearch/datebooksearch.cpp +++ b/core/pim/osearch/datebooksearch.cpp | |||
@@ -18,45 +18,46 @@ | |||
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 | #ifdef LIPBOPIE_SEARCH | 40 | #ifdef LIPBOPIE_SEARCH |
41 | ORecordList<OEvent> results = _dates->matchRegexp(_search); | 41 | ORecordList<OEvent> results = _dates->matchRegexp(_search); |
42 | setText(0, text(0) + " (" + QString::number( results.count() ) + ")" ); | ||
42 | for (uint i = 0; i < results.count(); i++) { | 43 | for (uint i = 0; i < results.count(); i++) { |
43 | new EventItem( this, new OEvent( results[i] )); | 44 | new EventItem( this, new OEvent( results[i] )); |
44 | } | 45 | } |
45 | #else | 46 | #else |
46 | ORecordList<OEvent> list = _dates->allRecords(); | 47 | ORecordList<OEvent> list = _dates->allRecords(); |
47 | QArray<int> m_currentQuery( list.count() ); | 48 | QArray<int> m_currentQuery( list.count() ); |
48 | for( uint i=0; i<list.count(); i++ ){ | 49 | for( uint i=0; i<list.count(); i++ ){ |
49 | //qDebug("datebook: %s",list[i].description().latin1() ); | 50 | //qDebug("datebook: %s",list[i].description().latin1() ); |
50 | if ( | 51 | if ( |
51 | ( list[i].description().contains( _search ) ) || | 52 | ( list[i].description().contains( _search ) ) || |
52 | ( list[i].note().contains( _search ) ) || | 53 | ( list[i].note().contains( _search ) ) || |
53 | ( list[i].location().contains( _search ) ) | 54 | ( list[i].location().contains( _search ) ) |
54 | ){ | 55 | ){ |
55 | //qDebug("FOUND"); | 56 | //qDebug("FOUND"); |
56 | new EventItem( this, new OEvent( list[i] ) ); | 57 | new EventItem( this, new OEvent( list[i] ) ); |
57 | } | 58 | } |
58 | 59 | ||
59 | } | 60 | } |
60 | #endif | 61 | #endif |
61 | } | 62 | } |
62 | 63 | ||