summaryrefslogtreecommitdiff
path: root/core/pim/osearch/searchgroup.cpp
Side-by-side diff
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
@@ -7,21 +7,21 @@
//
// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
//
// Copyright: See COPYING file that comes with this distribution
//
//
-#include "searchgroup.h"
+#include <qobject.h>
#include <qregexp.h>
#include <qapplication.h>
#include <opie/owait.h>
#include "olistviewitem.h"
+#include "searchgroup.h"
-//#define NEW_OWAIT
#ifndef NEW_OWAIT
static OWait *wait = 0;
#endif
SearchGroup::SearchGroup(QListView* parent, QString name)
: OListViewItem(parent, name)
@@ -36,13 +36,13 @@ SearchGroup::~SearchGroup()
}
void SearchGroup::expand()
{
//expanded = true;
- clearList();
+ if (_lastSearch != _search) clearList();
if (_search.isEmpty()) return;
OListViewItem *dummy = new OListViewItem( this, "searching...");
setOpen( true );
repaint();
int res_count = realSearch();
setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")");
@@ -66,28 +66,27 @@ void SearchGroup::setSearch(QRegExp re)
if (isOpen()) expand();
else new OListViewItem( this, "searching...");
}
int SearchGroup::realSearch()
{
+ if (_lastSearch == _search) return _resultCount;
#ifndef NEW_OWAIT
- qDebug("NOT using NEW_OWAIT");
if (!wait) wait = new OWait( qApp->mainWidget(), "osearch" );
wait->show();
qApp->processEvents();
#else
- qDebug("using NEW_OWAIT");
- OWait::start( "osearch" );
+ qDebug("********** NEW_OWAIT *************");
+ OWait( "searching" );
#endif
if (!loaded) load();
_resultCount = 0;
_resultCount = search();
+ _lastSearch = _search;
setText(0, _name + " - " + _search.pattern() + " (" + QString::number( _resultCount ) + ")");
#ifndef NEW_OWAIT
wait->hide();
-#else
- OWait::stop();
#endif
return _resultCount;
}