summaryrefslogtreecommitdiff
path: root/core/pim/osearch/searchgroup.cpp
Unidiff
Diffstat (limited to 'core/pim/osearch/searchgroup.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/searchgroup.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/core/pim/osearch/searchgroup.cpp b/core/pim/osearch/searchgroup.cpp
index e307696..0b58176 100644
--- a/core/pim/osearch/searchgroup.cpp
+++ b/core/pim/osearch/searchgroup.cpp
@@ -10,15 +10,15 @@
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 "searchgroup.h"
14 13
14#include <qobject.h>
15#include <qregexp.h> 15#include <qregexp.h>
16#include <qapplication.h> 16#include <qapplication.h>
17#include <opie/owait.h> 17#include <opie/owait.h>
18 18
19#include "olistviewitem.h" 19#include "olistviewitem.h"
20#include "searchgroup.h"
20 21
21//#define NEW_OWAIT
22#ifndef NEW_OWAIT 22#ifndef NEW_OWAIT
23static OWait *wait = 0; 23static OWait *wait = 0;
24#endif 24#endif
@@ -39,7 +39,7 @@ SearchGroup::~SearchGroup()
39void SearchGroup::expand() 39void SearchGroup::expand()
40{ 40{
41 //expanded = true; 41 //expanded = true;
42 clearList(); 42 if (_lastSearch != _search) clearList();
43 if (_search.isEmpty()) return; 43 if (_search.isEmpty()) return;
44 OListViewItem *dummy = new OListViewItem( this, "searching..."); 44 OListViewItem *dummy = new OListViewItem( this, "searching...");
45 setOpen( true ); 45 setOpen( true );
@@ -69,24 +69,23 @@ void SearchGroup::setSearch(QRegExp re)
69 69
70int SearchGroup::realSearch() 70int SearchGroup::realSearch()
71{ 71{
72 if (_lastSearch == _search) return _resultCount;
72#ifndef NEW_OWAIT 73#ifndef NEW_OWAIT
73 qDebug("NOT using NEW_OWAIT");
74 if (!wait) wait = new OWait( qApp->mainWidget(), "osearch" ); 74 if (!wait) wait = new OWait( qApp->mainWidget(), "osearch" );
75 wait->show(); 75 wait->show();
76 qApp->processEvents(); 76 qApp->processEvents();
77#else 77#else
78 qDebug("using NEW_OWAIT"); 78 qDebug("********** NEW_OWAIT *************");
79 OWait::start( "osearch" ); 79 OWait( "searching" );
80#endif 80#endif
81 if (!loaded) load(); 81 if (!loaded) load();
82 _resultCount = 0; 82 _resultCount = 0;
83 _resultCount = search(); 83 _resultCount = search();
84 _lastSearch = _search;
84 setText(0, _name + " - " + _search.pattern() + " (" + QString::number( _resultCount ) + ")"); 85 setText(0, _name + " - " + _search.pattern() + " (" + QString::number( _resultCount ) + ")");
85 86
86#ifndef NEW_OWAIT 87#ifndef NEW_OWAIT
87 wait->hide(); 88 wait->hide();
88#else
89 OWait::stop();
90#endif 89#endif
91 return _resultCount; 90 return _resultCount;
92} 91}