summaryrefslogtreecommitdiff
path: root/core/pim/osearch/searchgroup.cpp
authortille <tille>2003-05-15 13:55:07 (UTC)
committer tille <tille>2003-05-15 13:55:07 (UTC)
commit80e9fd1b08a3a7173ecf443b2830df4ca6e83ce6 (patch) (side-by-side diff)
tree4245ef4caf67784b452b908a9528ae03f988bf4c /core/pim/osearch/searchgroup.cpp
parentded2a7a5715af1d1f6aab0b79ba90d8a815a9adc (diff)
downloadopie-80e9fd1b08a3a7173ecf443b2830df4ca6e83ce6.zip
opie-80e9fd1b08a3a7173ecf443b2830df4ca6e83ce6.tar.gz
opie-80e9fd1b08a3a7173ecf443b2830df4ca6e83ce6.tar.bz2
owait and settings for search group:
- hide completed todos - show only later events - do not display hits in datebook dated
Diffstat (limited to 'core/pim/osearch/searchgroup.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/searchgroup.cpp50
1 files changed, 28 insertions, 22 deletions
diff --git a/core/pim/osearch/searchgroup.cpp b/core/pim/osearch/searchgroup.cpp
index 490deea..e307696 100644
--- a/core/pim/osearch/searchgroup.cpp
+++ b/core/pim/osearch/searchgroup.cpp
@@ -13,11 +13,16 @@
#include "searchgroup.h"
#include <qregexp.h>
-// #include <qapplication.h>
-// #include <opie/owait.h>
+#include <qapplication.h>
+#include <opie/owait.h>
#include "olistviewitem.h"
+//#define NEW_OWAIT
+#ifndef NEW_OWAIT
+static OWait *wait = 0;
+#endif
+
SearchGroup::SearchGroup(QListView* parent, QString name)
: OListViewItem(parent, name)
{
@@ -49,24 +54,13 @@ void SearchGroup::doSearch()
{
clearList();
if (_search.isEmpty()) return;
- int res_count = realSearch();
- setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")");
+ _resultCount = realSearch();
// repaint();
}
-void SearchGroup::clearList()
-{
- QListViewItem *item = firstChild();
- QListViewItem *toDel;
- while ( item != 0 ) {
- toDel = item;
- item = item->nextSibling();
- delete toDel;
- }
-}
-
void SearchGroup::setSearch(QRegExp re)
{
+ if (re == _search) return;
setText(0, _name+" - "+re.pattern() );
_search = re;
if (isOpen()) expand();
@@ -75,13 +69,25 @@ void SearchGroup::setSearch(QRegExp re)
int SearchGroup::realSearch()
{
- //emit isSearching( tr(" Searching for %s in %s" ).arg( _search.pattern().latin1()).arg( _name ) );
-/* OWait *wait = new OWait( qApp->mainWidget(), "test" );
- wait->show();*/
+#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" );
+#endif
if (!loaded) load();
- int count = search();
-/* wait->hide();
- delete wait;*/
- return count;
+ _resultCount = 0;
+ _resultCount = search();
+ setText(0, _name + " - " + _search.pattern() + " (" + QString::number( _resultCount ) + ")");
+
+#ifndef NEW_OWAIT
+ wait->hide();
+#else
+ OWait::stop();
+#endif
+ return _resultCount;
}