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