summaryrefslogtreecommitdiff
path: root/core
authortille <tille>2003-05-11 19:29:27 (UTC)
committer tille <tille>2003-05-11 19:29:27 (UTC)
commit10de2c93dffa16f6d2f1cf72fa20008757c5ef3a (patch) (side-by-side diff)
tree561f501cf966e1f3ee6c9ce6d76ab9c227e7708a /core
parent43c18630840a98aed8deb96b454957c40f0a4344 (diff)
downloadopie-10de2c93dffa16f6d2f1cf72fa20008757c5ef3a.zip
opie-10de2c93dffa16f6d2f1cf72fa20008757c5ef3a.tar.gz
opie-10de2c93dffa16f6d2f1cf72fa20008757c5ef3a.tar.bz2
colabse applnkitem in case of new search, since it's far to slow...
... I wonder how slow osearch will be on the pda!
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/applnksearch.cpp8
-rw-r--r--core/pim/osearch/applnksearch.h2
-rw-r--r--core/pim/osearch/searchgroup.h1
3 files changed, 9 insertions, 2 deletions
diff --git a/core/pim/osearch/applnksearch.cpp b/core/pim/osearch/applnksearch.cpp
index d5b2930..acf650a 100644
--- a/core/pim/osearch/applnksearch.cpp
+++ b/core/pim/osearch/applnksearch.cpp
@@ -32,24 +32,32 @@ AppLnkSearch::~AppLnkSearch()
void AppLnkSearch::load()
{
_apps = new AppLnkSet(QPEApplication::qpeDir());
}
int AppLnkSearch::search()
{
int count = 0;
QList<AppLnk> appList = _apps->children();
for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){
if ( (_search.match( app->name() ) != -1)
|| (_search.match(app->comment()) != -1)
|| (_search.match(app->exec()) != -1) ) {
count++;
insertItem( app );
}
}
return count;
}
void AppLnkSearch::insertItem( void *rec )
{
new AppLnkItem( this, (AppLnk*)rec );
}
+
+void AppLnkSearch::setSearch(QRegExp re)
+{
+ expanded = false;
+ setOpen( false );
+ SearchGroup::setSearch( re );
+}
+
diff --git a/core/pim/osearch/applnksearch.h b/core/pim/osearch/applnksearch.h
index d88a8ce..6bb7486 100644
--- a/core/pim/osearch/applnksearch.h
+++ b/core/pim/osearch/applnksearch.h
@@ -6,33 +6,33 @@
//
//
// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef APPLNKSEARCH_H
#define APPLNKSEARCH_H
#include "searchgroup.h"
class AppLnkSet;
/**
@author Patrick S. Vogt
*/
class AppLnkSearch : public SearchGroup
{
public:
AppLnkSearch(QListView* parent, QString name);
~AppLnkSearch();
-protected:
+ virtual void setSearch(QRegExp);
virtual void load();
virtual int search();
virtual void insertItem( void* );
AppLnkSet *_apps;
};
#endif
diff --git a/core/pim/osearch/searchgroup.h b/core/pim/osearch/searchgroup.h
index ebe1193..35949f0 100644
--- a/core/pim/osearch/searchgroup.h
+++ b/core/pim/osearch/searchgroup.h
@@ -18,32 +18,31 @@
class QRegExp;
/**
@author Patrick S. Vogt
*/
class SearchGroup : public OListViewItem
{
public:
SearchGroup(QListView* parent, QString name);
~SearchGroup();
virtual void expand();
virtual void setSearch(QString);
virtual void setSearch(QRegExp);
virtual int rtti() { return Searchgroup;}
protected:
QRegExp _search;
virtual void load() = 0;
virtual int search() = 0;
virtual void insertItem( void* ) = 0;
-private:
void clearList();
QString _name;
bool expanded;
bool loaded;
};
#endif