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.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/pim/osearch/applnksearch.cpp b/core/pim/osearch/applnksearch.cpp
index b15275a..e8170c5 100644
--- a/core/pim/osearch/applnksearch.cpp
+++ b/core/pim/osearch/applnksearch.cpp
@@ -1,68 +1,70 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "applnksearch.h" 13#include "applnksearch.h"
14 14
15#include <qpe/applnk.h> 15#include <qpe/applnk.h>
16#include <qpe/qpeapplication.h> 16#include <qpe/qpeapplication.h>
17#include <qiconset.h> 17#include <qiconset.h>
18#include <qpe/resource.h> 18#include <qpe/resource.h>
19 19
20#include "applnkitem.h" 20#include "applnkitem.h"
21 21
22
22AppLnkSearch::AppLnkSearch(QListView* parent, QString name): SearchGroup(parent, name) 23AppLnkSearch::AppLnkSearch(QListView* parent, QString name): SearchGroup(parent, name)
23{ 24{
24 _apps = 0; 25 _apps = 0;
25 QIconSet is = Resource::loadIconSet( "osearch/applications" ); 26 QIconSet is = Resource::loadIconSet( "osearch/applicationsSmall" );
26 //QIconSet is = Resource::loadIconSet( "AppsIcon" ); 27 //QIconSet is = Resource::loadIconSet( "AppsIcon" );
27 setPixmap( 0, is.pixmap( QIconSet::Small, true ) ); 28 setPixmap( 0, is.pixmap( QIconSet::Large, true ) );
28} 29}
29 30
30 31
31AppLnkSearch::~AppLnkSearch() 32AppLnkSearch::~AppLnkSearch()
32{ 33{
33 delete _apps; 34 delete _apps;
34} 35}
35 36
36 37
37void AppLnkSearch::load() 38void AppLnkSearch::load()
38{ 39{
39 _apps = new AppLnkSet(QPEApplication::qpeDir()); 40 _apps = new AppLnkSet(QPEApplication::qpeDir());
40} 41}
41 42
42int AppLnkSearch::search() 43int AppLnkSearch::search()
43{ 44{
44 QList<AppLnk> appList = _apps->children(); 45 QList<AppLnk> appList = _apps->children();
46
45 for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){ 47 for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){
46 if ( (_search.match( app->name() ) != -1) 48 if ( (_search.match( app->name() ) != -1)
47 || (_search.match(app->comment()) != -1) 49 || (_search.match(app->comment()) != -1)
48 || (_search.match(app->exec()) != -1) ) { 50 || (_search.match(app->exec()) != -1) ) {
49 insertItem( app ); 51 insertItem( app );
50 }else 52 }else
51 if (searchFile( app )) 53 if (searchFile( app ))
52 insertItem( app ); 54 insertItem( app );
53 qApp->processEvents( 100 ); 55 qApp->processEvents( 100 );
54 } 56 }
55 return _resultCount; 57 return _resultCount;
56} 58}
57 59
58void AppLnkSearch::insertItem( void *rec ) 60void AppLnkSearch::insertItem( void *rec )
59{ 61{
60 (void)new AppLnkItem( this, (AppLnk*)rec ); 62 (void)new AppLnkItem( this, (AppLnk*)rec );
61 _resultCount++; 63 _resultCount++;
62} 64}
63 65
64void AppLnkSearch::setSearch(QRegExp re) 66void AppLnkSearch::setSearch(QRegExp re)
65{ 67{
66 setOpen( false ); 68 setOpen( false );
67 SearchGroup::setSearch( re ); 69 SearchGroup::setSearch( re );
68} 70}