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.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/core/pim/osearch/applnksearch.cpp b/core/pim/osearch/applnksearch.cpp
index 1c84d66..758baf2 100644
--- a/core/pim/osearch/applnksearch.cpp
+++ b/core/pim/osearch/applnksearch.cpp
@@ -1,68 +1,67 @@
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#include "applnkitem.h" 14#include "applnkitem.h"
15 15
16#include <qpe/applnk.h> 16#include <qpe/applnk.h>
17#include <qpe/qpeapplication.h> 17#include <qpe/qpeapplication.h>
18#include <qpe/resource.h> 18#include <qpe/resource.h>
19 19
20#include <qiconset.h>
21 20
22AppLnkSearch::AppLnkSearch(QListView* parent, QString name): SearchGroup(parent, name) 21AppLnkSearch::AppLnkSearch(QListView* parent, QString name): SearchGroup(parent, name)
23{ 22{
24 _apps = 0; 23 _apps = 0;
25 QIconSet is = Resource::loadIconSet( "osearch/applicationsSmall" ); 24 QIconSet is = Resource::loadIconSet( "osearch/applicationsSmall" );
26 //QIconSet is = Resource::loadIconSet( "AppsIcon" ); 25 //QIconSet is = Resource::loadIconSet( "AppsIcon" );
27 setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); 26 setPixmap( 0, is.pixmap( QIconSet::Large, true ) );
28} 27}
29 28
30 29
31AppLnkSearch::~AppLnkSearch() 30AppLnkSearch::~AppLnkSearch()
32{ 31{
33 delete _apps; 32 delete _apps;
34} 33}
35 34
36 35
37void AppLnkSearch::load() 36void AppLnkSearch::load()
38{ 37{
39 _apps = new AppLnkSet(QPEApplication::qpeDir()); 38 _apps = new AppLnkSet(QPEApplication::qpeDir());
40} 39}
41 40
42int AppLnkSearch::search() 41int AppLnkSearch::search()
43{ 42{
44 QList<AppLnk> appList = _apps->children(); 43 QList<AppLnk> appList = _apps->children();
45 44
46 for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){ 45 for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){
47 if ( (_search.match( app->name() ) != -1) 46 if ( (_search.match( app->name() ) != -1)
48 || (_search.match(app->comment()) != -1) 47 || (_search.match(app->comment()) != -1)
49 || (_search.match(app->exec()) != -1) ) { 48 || (_search.match(app->exec()) != -1) ) {
50 insertItem( app ); 49 insertItem( app );
51 }else 50 }else
52 if (searchFile( app )) 51 if (searchFile( app ))
53 insertItem( app ); 52 insertItem( app );
54 qApp->processEvents( 100 ); 53 qApp->processEvents( 100 );
55 } 54 }
56 return _resultCount; 55 return _resultCount;
57} 56}
58 57
59void AppLnkSearch::insertItem( void *rec ) 58void AppLnkSearch::insertItem( void *rec )
60{ 59{
61 (void)new AppLnkItem( this, (AppLnk*)rec ); 60 (void)new AppLnkItem( this, (AppLnk*)rec );
62 _resultCount++; 61 _resultCount++;
63} 62}
64 63
65void AppLnkSearch::setSearch(QRegExp re) 64void AppLnkSearch::setSearch(QRegExp re)
66{ 65{
67 setOpen( false ); 66 setOpen( false );
68 SearchGroup::setSearch( re ); 67 SearchGroup::setSearch( re );