From 75f1e9815410e75a6f9ae76d8db716c0c315ea45 Mon Sep 17 00:00:00 2001 From: tille Date: Fri, 16 May 2003 15:18:21 +0000 Subject: search in text documents --- (limited to 'core/pim/osearch/searchgroup.cpp') 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 @@ // Copyright: See COPYING file that comes with this distribution // // -#include "searchgroup.h" +#include #include #include #include #include "olistviewitem.h" +#include "searchgroup.h" -//#define NEW_OWAIT #ifndef NEW_OWAIT static OWait *wait = 0; #endif @@ -39,7 +39,7 @@ SearchGroup::~SearchGroup() void SearchGroup::expand() { //expanded = true; - clearList(); + if (_lastSearch != _search) clearList(); if (_search.isEmpty()) return; OListViewItem *dummy = new OListViewItem( this, "searching..."); setOpen( true ); @@ -69,24 +69,23 @@ void SearchGroup::setSearch(QRegExp re) 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; } -- cgit v0.9.0.2