Diffstat (limited to 'core/pim/osearch/todosearch.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/osearch/todosearch.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp index 8de875e..5042803 100644 --- a/core/pim/osearch/todosearch.cpp +++ b/core/pim/osearch/todosearch.cpp | |||
@@ -2,33 +2,33 @@ | |||
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 "todosearch.h" | 13 | #include "todosearch.h" |
14 | #include "todoitem.h" | ||
14 | 15 | ||
15 | #include <opie/otodoaccess.h> | ||
16 | #include <opie/otodo.h> | ||
17 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
18 | #include <qpe/config.h> | 17 | #include <qpe/config.h> |
18 | |||
19 | #include <qiconset.h> | 19 | #include <qiconset.h> |
20 | #include <qaction.h> | 20 | #include <qaction.h> |
21 | #include <qpopupmenu.h> | 21 | #include <qpopupmenu.h> |
22 | #include "todoitem.h" | 22 | |
23 | 23 | ||
24 | TodoSearch::TodoSearch(QListView* parent, QString name) | 24 | TodoSearch::TodoSearch(QListView* parent, QString name) |
25 | : SearchGroup(parent, name), _todos(0), _popupMenu(0) | 25 | : SearchGroup(parent, name), _todos(0), _popupMenu(0) |
26 | { | 26 | { |
27 | //AppLnkSet als(QPEApplication::qpeDir()); | 27 | //AppLnkSet als(QPEApplication::qpeDir()); |
28 | //setPixmap( 0, als.findExec("todolist")->pixmap() ); | 28 | //setPixmap( 0, als.findExec("todolist")->pixmap() ); |
29 | QIconSet is = Resource::loadIconSet( "todo/TodoListSmall" ); | 29 | QIconSet is = Resource::loadIconSet( "todo/TodoListSmall" ); |
30 | setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); | 30 | setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); |
31 | actionShowCompleted = new QAction( QObject::tr("show completed tasks"),QString::null, 0, 0, 0, true ); | 31 | actionShowCompleted = new QAction( QObject::tr("show completed tasks"),QString::null, 0, 0, 0, true ); |
32 | Config cfg( "osearch", Config::User ); | 32 | Config cfg( "osearch", Config::User ); |
33 | cfg.setGroup( "todo_settings" ); | 33 | cfg.setGroup( "todo_settings" ); |
34 | actionShowCompleted->setOn( cfg.readBoolEntry( "show_completed_tasks", false ) ); | 34 | actionShowCompleted->setOn( cfg.readBoolEntry( "show_completed_tasks", false ) ); |
@@ -40,39 +40,39 @@ TodoSearch::~TodoSearch() | |||
40 | { | 40 | { |
41 | Config cfg( "osearch", Config::User ); | 41 | Config cfg( "osearch", Config::User ); |
42 | cfg.setGroup( "todo_settings" ); | 42 | cfg.setGroup( "todo_settings" ); |
43 | cfg.writeEntry( "show_completed_tasks", actionShowCompleted->isOn() ); | 43 | cfg.writeEntry( "show_completed_tasks", actionShowCompleted->isOn() ); |
44 | delete _popupMenu; | 44 | delete _popupMenu; |
45 | delete actionShowCompleted; | 45 | delete actionShowCompleted; |
46 | delete _todos; | 46 | delete _todos; |
47 | } | 47 | } |
48 | 48 | ||
49 | 49 | ||
50 | void TodoSearch::load() | 50 | void TodoSearch::load() |
51 | { | 51 | { |
52 | _todos = new OTodoAccess(); | 52 | _todos = new OPimTodoAccess(); |
53 | _todos->load(); | 53 | _todos->load(); |
54 | } | 54 | } |
55 | 55 | ||
56 | int TodoSearch::search() | 56 | int TodoSearch::search() |
57 | { | 57 | { |
58 | ORecordList<OTodo> results = _todos->matchRegexp(_search); | 58 | OPimRecordList<OPimTodo> results = _todos->matchRegexp(_search); |
59 | for (uint i = 0; i < results.count(); i++) | 59 | for (uint i = 0; i < results.count(); i++) |
60 | insertItem( new OTodo( results[i] )); | 60 | insertItem( new OPimTodo( results[i] )); |
61 | return _resultCount; | 61 | return _resultCount; |
62 | } | 62 | } |
63 | 63 | ||
64 | void TodoSearch::insertItem( void *rec ) | 64 | void TodoSearch::insertItem( void *rec ) |
65 | { | 65 | { |
66 | OTodo *todo = (OTodo*)rec; | 66 | OPimTodo *todo = (OPimTodo*)rec; |
67 | if (!actionShowCompleted->isOn() && | 67 | if (!actionShowCompleted->isOn() && |
68 | todo->isCompleted() ) return; | 68 | todo->isCompleted() ) return; |
69 | (void)new TodoItem( this, todo ); | 69 | (void)new TodoItem( this, todo ); |
70 | _resultCount++; | 70 | _resultCount++; |
71 | } | 71 | } |
72 | 72 | ||
73 | QPopupMenu* TodoSearch::popupMenu() | 73 | QPopupMenu* TodoSearch::popupMenu() |
74 | { | 74 | { |
75 | if (!_popupMenu){ | 75 | if (!_popupMenu){ |
76 | _popupMenu = new QPopupMenu( 0 ); | 76 | _popupMenu = new QPopupMenu( 0 ); |
77 | actionShowCompleted->addTo( _popupMenu ); | 77 | actionShowCompleted->addTo( _popupMenu ); |
78 | } | 78 | } |