Diffstat (limited to 'core/pim/osearch/searchgroup.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/osearch/searchgroup.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/core/pim/osearch/searchgroup.cpp b/core/pim/osearch/searchgroup.cpp index d062207..3159984 100644 --- a/core/pim/osearch/searchgroup.cpp +++ b/core/pim/osearch/searchgroup.cpp | |||
@@ -39,12 +39,20 @@ void SearchGroup::expand() | |||
39 | if (!loaded) load(); | 39 | if (!loaded) load(); |
40 | int res_count = search(); | 40 | int res_count = search(); |
41 | setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")"); | 41 | setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")"); |
42 | delete dummy; | 42 | delete dummy; |
43 | } | 43 | } |
44 | 44 | ||
45 | void SearchGroup::doSearch() | ||
46 | { | ||
47 | clearList(); | ||
48 | if (_search.isEmpty()) return; | ||
49 | if (!loaded) load(); | ||
50 | int res_count = search(); | ||
51 | setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")"); | ||
52 | } | ||
45 | 53 | ||
46 | void SearchGroup::clearList() | 54 | void SearchGroup::clearList() |
47 | { | 55 | { |
48 | QListViewItem *item = firstChild(); | 56 | QListViewItem *item = firstChild(); |
49 | QListViewItem *toDel; | 57 | QListViewItem *toDel; |
50 | 58 | ||
@@ -53,19 +61,12 @@ void SearchGroup::clearList() | |||
53 | item = item->nextSibling(); | 61 | item = item->nextSibling(); |
54 | delete toDel; | 62 | delete toDel; |
55 | } | 63 | } |
56 | expanded = true; | 64 | expanded = true; |
57 | } | 65 | } |
58 | 66 | ||
59 | void SearchGroup::setSearch(QString s) | ||
60 | { | ||
61 | setSearch( QRegExp( s ) ); | ||
62 | _search.setCaseSensitive(false); | ||
63 | } | ||
64 | |||
65 | |||
66 | void SearchGroup::setSearch(QRegExp re) | 67 | void SearchGroup::setSearch(QRegExp re) |
67 | { | 68 | { |
68 | setText(0, _name+" - "+re.pattern() ); | 69 | setText(0, _name+" - "+re.pattern() ); |
69 | _search = re; | 70 | _search = re; |
70 | if (expanded) expand(); | 71 | if (expanded) expand(); |
71 | else new OListViewItem( this, "searching..."); | 72 | else new OListViewItem( this, "searching..."); |