Diffstat (limited to 'core/pim/osearch/searchgroup.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/osearch/searchgroup.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/core/pim/osearch/searchgroup.cpp b/core/pim/osearch/searchgroup.cpp index 5377b9f..7a0b5a7 100644 --- a/core/pim/osearch/searchgroup.cpp +++ b/core/pim/osearch/searchgroup.cpp | |||
@@ -1,67 +1,64 @@ | |||
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 "olistviewitem.h" | ||
14 | #include "searchgroup.h" | 13 | #include "searchgroup.h" |
15 | 14 | ||
16 | #include <opie2/owait.h> | 15 | #include <opie2/owait.h> |
17 | 16 | ||
18 | #include <qobject.h> | ||
19 | #include <qregexp.h> | ||
20 | #include <qapplication.h> | 17 | #include <qapplication.h> |
21 | 18 | ||
22 | #ifndef NEW_OWAIT | 19 | #ifndef NEW_OWAIT |
23 | static OWait *wait = 0; | 20 | static OWait *wait = 0; |
24 | #endif | 21 | #endif |
25 | 22 | ||
26 | SearchGroup::SearchGroup(QListView* parent, QString name) | 23 | SearchGroup::SearchGroup(QListView* parent, QString name) |
27 | : OListViewItem(parent, name) | 24 | : OListViewItem(parent, name) |
28 | { | 25 | { |
29 | _name = name; | 26 | _name = name; |
30 | loaded = false; | 27 | loaded = false; |
31 | } | 28 | } |
32 | 29 | ||
33 | 30 | ||
34 | SearchGroup::~SearchGroup() | 31 | SearchGroup::~SearchGroup() |
35 | { | 32 | { |
36 | } | 33 | } |
37 | 34 | ||
38 | 35 | ||
39 | void SearchGroup::expand() | 36 | void SearchGroup::expand() |
40 | { | 37 | { |
41 | //expanded = true; | 38 | //expanded = true; |
42 | if (_lastSearch != _search) clearList(); | 39 | if (_lastSearch != _search) clearList(); |
43 | if (_search.isEmpty()) return; | 40 | if (_search.isEmpty()) return; |
44 | OListViewItem *dummy = new OListViewItem( this, "searching..."); | 41 | OListViewItem *dummy = new OListViewItem( this, "searching..."); |
45 | setOpen( true ); | 42 | setOpen( true ); |
46 | repaint(); | 43 | repaint(); |
47 | int res_count = realSearch(); | 44 | int res_count = realSearch(); |
48 | setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")"); | 45 | setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")"); |
49 | delete dummy; | 46 | delete dummy; |
50 | repaint(); | 47 | repaint(); |
51 | } | 48 | } |
52 | 49 | ||
53 | void SearchGroup::doSearch() | 50 | void SearchGroup::doSearch() |
54 | { | 51 | { |
55 | clearList(); | 52 | clearList(); |
56 | if (_search.isEmpty()) return; | 53 | if (_search.isEmpty()) return; |
57 | _resultCount = realSearch(); | 54 | _resultCount = realSearch(); |
58 | //repaint(); | 55 | //repaint(); |
59 | } | 56 | } |
60 | 57 | ||
61 | void SearchGroup::setSearch(QRegExp re) | 58 | void SearchGroup::setSearch(QRegExp re) |
62 | { | 59 | { |
63 | if (re == _search) return; | 60 | if (re == _search) return; |
64 | setText(0, _name+" - "+re.pattern() ); | 61 | setText(0, _name+" - "+re.pattern() ); |
65 | _search = re; | 62 | _search = re; |
66 | if (isOpen()) expand(); | 63 | if (isOpen()) expand(); |
67 | else new OListViewItem( this, "searching..."); | 64 | else new OListViewItem( this, "searching..."); |