author | tille <tille> | 2003-05-08 13:22:51 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-08 13:22:51 (UTC) |
commit | 08f9d5965b127b0b889b96cf16b7d34b5a9a6928 (patch) (unidiff) | |
tree | 7d17bfff623ba6cfb105ae9144e51378a71de040 | |
parent | 763d7d7da84682fb87a631a997e93c08f5abde61 (diff) | |
download | opie-08f9d5965b127b0b889b96cf16b7d34b5a9a6928.zip opie-08f9d5965b127b0b889b96cf16b7d34b5a9a6928.tar.gz opie-08f9d5965b127b0b889b96cf16b7d34b5a9a6928.tar.bz2 |
now it 'works' with the current libopie, again
-rw-r--r-- | core/pim/osearch/datebooksearch.cpp | 3 | ||||
-rw-r--r-- | core/pim/osearch/osearch.pro | 5 | ||||
-rw-r--r-- | core/pim/osearch/searchgroup.h | 2 | ||||
-rw-r--r-- | core/pim/osearch/todosearch.cpp | 6 |
4 files changed, 7 insertions, 9 deletions
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp index e60a3b1..8f9d472 100644 --- a/core/pim/osearch/datebooksearch.cpp +++ b/core/pim/osearch/datebooksearch.cpp | |||
@@ -1,63 +1,62 @@ | |||
1 | // | 1 | // |
2 | // | 2 | // |
3 | // C++ Implementation: $MODULE$ | 3 | // C++ Implementation: $MODULE$ |
4 | // | 4 | // |
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 "datebooksearch.h" | 13 | #include "datebooksearch.h" |
14 | 14 | ||
15 | #include "eventitem.h" | 15 | #include "eventitem.h" |
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 | #define LIPBOPIE_SEARCH | ||
41 | #ifdef LIPBOPIE_SEARCH | 40 | #ifdef LIPBOPIE_SEARCH |
42 | ORecordList<OEvent> results = _dates->matchRegexp(_search); | 41 | ORecordList<OEvent> results = _dates->matchRegexp(_search); |
43 | for (uint i = 0; i < results.count(); i++) { | 42 | for (uint i = 0; i < results.count(); i++) { |
44 | new EventItem( this, new OEvent( results[i] )); | 43 | new EventItem( this, new OEvent( results[i] )); |
45 | } | 44 | } |
46 | #else | 45 | #else |
47 | ORecordList<OEvent> list = _dates->allRecords(); | 46 | ORecordList<OEvent> list = _dates->allRecords(); |
48 | QArray<int> m_currentQuery( list.count() ); | 47 | QArray<int> m_currentQuery( list.count() ); |
49 | for( uint i=0; i<list.count(); i++ ){ | 48 | for( uint i=0; i<list.count(); i++ ){ |
50 | //qDebug("datebook: %s",list[i].description().latin1() ); | 49 | //qDebug("datebook: %s",list[i].description().latin1() ); |
51 | if ( | 50 | if ( |
52 | ( list[i].description().contains( _search ) ) || | 51 | ( list[i].description().contains( _search ) ) || |
53 | ( list[i].note().contains( _search ) ) || | 52 | ( list[i].note().contains( _search ) ) || |
54 | ( list[i].location().contains( _search ) ) | 53 | ( list[i].location().contains( _search ) ) |
55 | ){ | 54 | ){ |
56 | //qDebug("FOUND"); | 55 | //qDebug("FOUND"); |
57 | new EventItem( this, new OEvent( list[i] ) ); | 56 | new EventItem( this, new OEvent( list[i] ) ); |
58 | } | 57 | } |
59 | 58 | ||
60 | } | 59 | } |
61 | #endif | 60 | #endif |
62 | } | 61 | } |
63 | 62 | ||
diff --git a/core/pim/osearch/osearch.pro b/core/pim/osearch/osearch.pro index 996eb53..397bc83 100644 --- a/core/pim/osearch/osearch.pro +++ b/core/pim/osearch/osearch.pro | |||
@@ -1,37 +1,32 @@ | |||
1 | # File generated by kdevelop's qmake manager. | ||
2 | # ------------------------------------------- | ||
3 | # Subdir relative project main directory: . | ||
4 | # Target is an application: osearch | ||
5 | |||
6 | DEPENDPATH += $(OPIEDIR)/ioclude | 1 | DEPENDPATH += $(OPIEDIR)/ioclude |
7 | LIBS += -lqpe -lopie | 2 | LIBS += -lqpe -lopie |
8 | INTERFACES = | 3 | INTERFACES = |
9 | include ( $(OPIEDIR)/include.pro ) | 4 | include ( $(OPIEDIR)/include.pro ) |
10 | TEMPLATE = app | 5 | TEMPLATE = app |
11 | CONFIG += debug warn_on qt | 6 | CONFIG += debug warn_on qt |
12 | DESTDIR = $(OPIEDIR)/bin | 7 | DESTDIR = $(OPIEDIR)/bin |
13 | TARGET = osearch | 8 | TARGET = osearch |
14 | INCLUDEPATH = $(OPIEDIR)/include | 9 | INCLUDEPATH = $(OPIEDIR)/include |
15 | SOURCES += main.cpp \ | 10 | SOURCES += main.cpp \ |
16 | mainwindow.cpp \ | 11 | mainwindow.cpp \ |
17 | olistview.cpp \ | 12 | olistview.cpp \ |
18 | olistviewitem.cpp \ | 13 | olistviewitem.cpp \ |
19 | adresssearch.cpp \ | 14 | adresssearch.cpp \ |
20 | todosearch.cpp \ | 15 | todosearch.cpp \ |
21 | datebooksearch.cpp \ | 16 | datebooksearch.cpp \ |
22 | searchgroup.cpp \ | 17 | searchgroup.cpp \ |
23 | resultitem.cpp \ | 18 | resultitem.cpp \ |
24 | todoitem.cpp \ | 19 | todoitem.cpp \ |
25 | contactitem.cpp \ | 20 | contactitem.cpp \ |
26 | eventitem.cpp | 21 | eventitem.cpp |
27 | HEADERS += mainwindow.h \ | 22 | HEADERS += mainwindow.h \ |
28 | olistview.h \ | 23 | olistview.h \ |
29 | olistviewitem.h \ | 24 | olistviewitem.h \ |
30 | adresssearch.h \ | 25 | adresssearch.h \ |
31 | todosearch.h \ | 26 | todosearch.h \ |
32 | datebooksearch.h \ | 27 | datebooksearch.h \ |
33 | searchgroup.h \ | 28 | searchgroup.h \ |
34 | resultitem.h \ | 29 | resultitem.h \ |
35 | todoitem.h \ | 30 | todoitem.h \ |
36 | contactitem.h \ | 31 | contactitem.h \ |
37 | eventitem.h | 32 | eventitem.h |
diff --git a/core/pim/osearch/searchgroup.h b/core/pim/osearch/searchgroup.h index d26ff17..6b6bbf5 100644 --- a/core/pim/osearch/searchgroup.h +++ b/core/pim/osearch/searchgroup.h | |||
@@ -1,42 +1,44 @@ | |||
1 | // | 1 | // |
2 | // | 2 | // |
3 | // C++ Interface: $MODULE$ | 3 | // C++ Interface: $MODULE$ |
4 | // | 4 | // |
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 | #ifndef SEARCHGROUP_H | 13 | #ifndef SEARCHGROUP_H |
14 | #define SEARCHGROUP_H | 14 | #define SEARCHGROUP_H |
15 | 15 | ||
16 | #include "olistviewitem.h" | 16 | #include "olistviewitem.h" |
17 | 17 | ||
18 | #include <qregexp.h> | 18 | #include <qregexp.h> |
19 | 19 | ||
20 | //#define LIPBOPIE_SEARCH | ||
21 | |||
20 | /** | 22 | /** |
21 | @author Patrick S. Vogt | 23 | @author Patrick S. Vogt |
22 | */ | 24 | */ |
23 | class SearchGroup : public OListViewItem | 25 | class SearchGroup : public OListViewItem |
24 | { | 26 | { |
25 | public: | 27 | public: |
26 | SearchGroup(QListView* parent, QString name); | 28 | SearchGroup(QListView* parent, QString name); |
27 | 29 | ||
28 | ~SearchGroup(); | 30 | ~SearchGroup(); |
29 | 31 | ||
30 | virtual void expand(); | 32 | virtual void expand(); |
31 | virtual void setSearch(QString); | 33 | virtual void setSearch(QString); |
32 | virtual void setSearch(QRegExp); | 34 | virtual void setSearch(QRegExp); |
33 | virtual int rtti() { return Searchgroup;} | 35 | virtual int rtti() { return Searchgroup;} |
34 | 36 | ||
35 | protected: | 37 | protected: |
36 | QRegExp _search; | 38 | QRegExp _search; |
37 | private: | 39 | private: |
38 | QString _name; | 40 | QString _name; |
39 | bool expanded; | 41 | bool expanded; |
40 | }; | 42 | }; |
41 | 43 | ||
42 | #endif | 44 | #endif |
diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp index 82fae8d..9a22ee1 100644 --- a/core/pim/osearch/todosearch.cpp +++ b/core/pim/osearch/todosearch.cpp | |||
@@ -1,63 +1,65 @@ | |||
1 | // | 1 | // |
2 | // | 2 | // |
3 | // C++ Implementation: $MODULE$ | 3 | // C++ Implementation: $MODULE$ |
4 | // | 4 | // |
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> | 17 | #include <qdir.h> |
18 | 18 | ||
19 | #include "todoitem.h" | 19 | #include "todoitem.h" |
20 | 20 | ||
21 | TodoSearch::TodoSearch(QListView* parent, QString name) | 21 | TodoSearch::TodoSearch(QListView* parent, QString name) |
22 | : SearchGroup(parent, name) | 22 | : SearchGroup(parent, name) |
23 | { | 23 | { |
24 | //_fileName = QDir::homeDirPath()+"/Applications/todolist/todolist.xml"; | 24 | //_fileName = QDir::homeDirPath()+"/Applications/todolist/todolist.xml"; |
25 | _todos = 0; | 25 | _todos = 0; |
26 | } | 26 | } |
27 | 27 | ||
28 | 28 | ||
29 | TodoSearch::~TodoSearch() | 29 | TodoSearch::~TodoSearch() |
30 | { | 30 | { |
31 | delete _todos; | 31 | delete _todos; |
32 | } | 32 | } |
33 | 33 | ||
34 | 34 | ||
35 | void TodoSearch::expand() | 35 | void TodoSearch::expand() |
36 | { | 36 | { |
37 | SearchGroup::expand(); | 37 | SearchGroup::expand(); |
38 | if (_search.isEmpty()) return; | 38 | if (_search.isEmpty()) return; |
39 | 39 | ||
40 | if (!_todos){ | 40 | if (!_todos){ |
41 | _todos = new OTodoAccess(); | 41 | _todos = new OTodoAccess(); |
42 | _todos->load(); | 42 | _todos->load(); |
43 | } | 43 | } |
44 | 44 | ||
45 | #ifdef LIPBOPIE_SEARCH | ||
45 | ORecordList<OTodo> results = _todos->matchRegexp(_search); | 46 | ORecordList<OTodo> results = _todos->matchRegexp(_search); |
46 | for (uint i = 0; i < results.count(); i++) { | 47 | for (uint i = 0; i < results.count(); i++) { |
47 | new TodoItem( this, new OTodo( results[i] )); | 48 | new TodoItem( this, new OTodo( results[i] )); |
48 | } | 49 | } |
49 | /* | 50 | #else |
50 | ORecordList<OTodo> list = _todos->allRecords(); | 51 | ORecordList<OTodo> list = _todos->allRecords(); |
51 | QArray<int> m_currentQuery( list.count() ); | 52 | QArray<int> m_currentQuery( list.count() ); |
52 | for( uint i=0; i<list.count(); i++ ){ | 53 | for( uint i=0; i<list.count(); i++ ){ |
53 | // qDebug("todo: %s",list[i].summary().latin1() ); | 54 | // qDebug("todo: %s",list[i].summary().latin1() ); |
54 | if ( list[i].match( _search ) ){ | 55 | if ( list[i].match( _search ) ){ |
55 | // qDebug("FOUND"); | 56 | // qDebug("FOUND"); |
56 | new TodoItem( this, new OTodo( list[i] ) ); | 57 | new TodoItem( this, new OTodo( list[i] ) ); |
57 | } | 58 | } |
58 | 59 | ||
59 | }*/ | 60 | } |
61 | #endif | ||
60 | 62 | ||
61 | } | 63 | } |
62 | 64 | ||
63 | 65 | ||