summaryrefslogtreecommitdiff
path: root/core/pim/osearch/applnksearch.cpp
Unidiff
Diffstat (limited to 'core/pim/osearch/applnksearch.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/osearch/applnksearch.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/core/pim/osearch/applnksearch.cpp b/core/pim/osearch/applnksearch.cpp
index 7872ae3..d5b2930 100644
--- a/core/pim/osearch/applnksearch.cpp
+++ b/core/pim/osearch/applnksearch.cpp
@@ -29,18 +29,27 @@ AppLnkSearch::~AppLnkSearch()
29} 29}
30 30
31 31
32void AppLnkSearch::expand() 32void AppLnkSearch::load()
33{ 33{
34 SearchGroup::expand(); 34 _apps = new AppLnkSet(QPEApplication::qpeDir());
35 if (_search.isEmpty()) return; 35}
36 if (!_apps) _apps = new AppLnkSet(QPEApplication::qpeDir()); 36
37int AppLnkSearch::search()
38{
39 int count = 0;
37 QList<AppLnk> appList = _apps->children(); 40 QList<AppLnk> appList = _apps->children();
38 for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){ 41 for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){
39 // if (app->name().contains(_search) || app->comment().contains(_search))
40 if ( (_search.match( app->name() ) != -1) 42 if ( (_search.match( app->name() ) != -1)
41 || (_search.match(app->comment()) != -1) 43 || (_search.match(app->comment()) != -1)
42 || (_search.match(app->exec()) != -1) ) 44 || (_search.match(app->exec()) != -1) ) {
43 new AppLnkItem( this, app ); 45 count++;
46 insertItem( app );
44 } 47 }
45} 48}
49 return count;
50}
46 51
52void AppLnkSearch::insertItem( void *rec )
53{
54 new AppLnkItem( this, (AppLnk*)rec );
55}