author | tille <tille> | 2003-05-11 19:19:30 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-11 19:19:30 (UTC) |
commit | 43c18630840a98aed8deb96b454957c40f0a4344 (patch) (unidiff) | |
tree | 60e5b68d1d172c77560d5af7bea83e81be7144a6 /core/pim/osearch/adresssearch.cpp | |
parent | 38dc2fd6258f11ba0507c7bd8f8dfd5b39bc0df5 (diff) | |
download | opie-43c18630840a98aed8deb96b454957c40f0a4344.zip opie-43c18630840a98aed8deb96b454957c40f0a4344.tar.gz opie-43c18630840a98aed8deb96b454957c40f0a4344.tar.bz2 |
improved applnk and doclnk searching
clean up:
- mainwindow: handling of searchgroups
- searchgroups: introduced load, search and insertItem functions
- flexible actions handling
- doclnksearch inherits applnksearch
Diffstat (limited to 'core/pim/osearch/adresssearch.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/adresssearch.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/core/pim/osearch/adresssearch.cpp b/core/pim/osearch/adresssearch.cpp index 0ee8eba..69ad9ef 100644 --- a/core/pim/osearch/adresssearch.cpp +++ b/core/pim/osearch/adresssearch.cpp | |||
@@ -21,25 +21,30 @@ | |||
21 | AdressSearch::AdressSearch(QListView* parent, QString name): | 21 | AdressSearch::AdressSearch(QListView* parent, QString name): |
22 | SearchGroup(parent, name) | 22 | SearchGroup(parent, name) |
23 | { | 23 | { |
24 | _contacts = 0; | 24 | _contacts = 0; |
25 | } | 25 | } |
26 | 26 | ||
27 | 27 | ||
28 | AdressSearch::~AdressSearch() | 28 | AdressSearch::~AdressSearch() |
29 | { | 29 | { |
30 | delete _contacts; | 30 | delete _contacts; |
31 | } | 31 | } |
32 | 32 | ||
33 | void AdressSearch::load() | ||
34 | { | ||
35 | _contacts = new OContactAccess("osearch"); | ||
36 | } | ||
33 | 37 | ||
34 | void AdressSearch::expand() | 38 | int AdressSearch::search() |
35 | { | 39 | { |
36 | SearchGroup::expand(); | ||
37 | if (_search.isEmpty()) return; | ||
38 | if (!_contacts) _contacts = new OContactAccess("osearch"); | ||
39 | ORecordList<OContact> results = _contacts->matchRegexp(_search); | 40 | ORecordList<OContact> results = _contacts->matchRegexp(_search); |
40 | setText(0, text(0) + " (" + QString::number( results.count() ) + ")" ); | ||
41 | for (uint i = 0; i < results.count(); i++) { | 41 | for (uint i = 0; i < results.count(); i++) { |
42 | new ContactItem( this, new OContact( results[i] )); | 42 | new ContactItem( this, new OContact( results[i] )); |
43 | } | 43 | } |
44 | return results.count(); | ||
44 | } | 45 | } |
45 | 46 | ||
47 | void AdressSearch::insertItem( void* ) | ||
48 | { | ||
49 | |||
50 | } | ||