Diffstat (limited to 'core/pim/osearch/datebooksearch.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/osearch/datebooksearch.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp index 50c76e0..2b4660a 100644 --- a/core/pim/osearch/datebooksearch.cpp +++ b/core/pim/osearch/datebooksearch.cpp | |||
@@ -8,25 +8,28 @@ | |||
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 "datebooksearch.h" | 13 | #include "datebooksearch.h" |
14 | |||
15 | #include "eventitem.h" | 14 | #include "eventitem.h" |
16 | 15 | ||
16 | #include <opie2/opimevent.h> | ||
17 | #include <opie2/opimrecurrence.h> | ||
18 | |||
19 | |||
17 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
18 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
19 | #include <opie/oevent.h> | 22 | |
20 | #include <opie/orecur.h> | ||
21 | #include <opie/odatebookaccess.h> | ||
22 | #include <qiconset.h> | 23 | #include <qiconset.h> |
23 | #include <qaction.h> | 24 | #include <qaction.h> |
24 | #include <qdatetime.h> | 25 | #include <qdatetime.h> |
25 | #include <qpopupmenu.h> | 26 | #include <qpopupmenu.h> |
26 | 27 | ||
28 | |||
29 | |||
27 | DatebookSearch::DatebookSearch(QListView* parent, QString name) | 30 | DatebookSearch::DatebookSearch(QListView* parent, QString name) |
28 | : SearchGroup(parent, name), _dates(0), _popupMenu(0) | 31 | : SearchGroup(parent, name), _dates(0), _popupMenu(0) |
29 | { | 32 | { |
30 | QIconSet is = Resource::loadIconSet( "datebook/DateBookSmall" ); | 33 | QIconSet is = Resource::loadIconSet( "datebook/DateBookSmall" ); |
31 | setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); | 34 | setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); |
32 | actionShowPastEvents = new QAction( QObject::tr("show past events"),QString::null, 0, 0, 0, true ); | 35 | actionShowPastEvents = new QAction( QObject::tr("show past events"),QString::null, 0, 0, 0, true ); |
@@ -56,21 +59,21 @@ void DatebookSearch::load() | |||
56 | _dates = new ODateBookAccess(); | 59 | _dates = new ODateBookAccess(); |
57 | _dates->load(); | 60 | _dates->load(); |
58 | } | 61 | } |
59 | 62 | ||
60 | int DatebookSearch::search() | 63 | int DatebookSearch::search() |
61 | { | 64 | { |
62 | ORecordList<OEvent> results = _dates->matchRegexp(_search); | 65 | OPimRecordList<OPimEvent> results = _dates->matchRegexp(_search); |
63 | for (uint i = 0; i < results.count(); i++) | 66 | for (uint i = 0; i < results.count(); i++) |
64 | insertItem( new OEvent( results[i] ) ); | 67 | insertItem( new OPimEvent( results[i] ) ); |
65 | return _resultCount; | 68 | return _resultCount; |
66 | } | 69 | } |
67 | 70 | ||
68 | void DatebookSearch::insertItem( void *rec ) | 71 | void DatebookSearch::insertItem( void *rec ) |
69 | { | 72 | { |
70 | OEvent *ev = (OEvent*)rec; | 73 | OPimEvent *ev = (OPimEvent*)rec; |
71 | if ( !actionShowPastEvents->isOn() && | 74 | if ( !actionShowPastEvents->isOn() && |
72 | ev->endDateTime() < QDateTime::currentDateTime() && | 75 | ev->endDateTime() < QDateTime::currentDateTime() && |
73 | !ev->recurrence().doesRecur() | 76 | !ev->recurrence().doesRecur() |
74 | ) return; | 77 | ) return; |
75 | if ( !actionSearchInDates->isOn() && ( | 78 | if ( !actionSearchInDates->isOn() && ( |
76 | ev->lastHitField() == Qtopia::StartDateTime || | 79 | ev->lastHitField() == Qtopia::StartDateTime || |