-rw-r--r-- | core/pim/osearch/todoitem.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/pim/osearch/todoitem.cpp b/core/pim/osearch/todoitem.cpp index be780a1..34e790a 100644 --- a/core/pim/osearch/todoitem.cpp +++ b/core/pim/osearch/todoitem.cpp | |||
@@ -1,82 +1,83 @@ | |||
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 "todoitem.h" | 13 | #include "todoitem.h" |
14 | 14 | ||
15 | 15 | ||
16 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
17 | #include <qpe/qcopenvelope_qws.h> | 17 | #include <qpe/qcopenvelope_qws.h> |
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | using namespace Opie; | ||
21 | TodoItem::TodoItem(OListViewItem* parent, OPimTodo *todo) | 22 | TodoItem::TodoItem(OListViewItem* parent, OPimTodo *todo) |
22 | : ResultItem(parent) | 23 | : ResultItem(parent) |
23 | { | 24 | { |
24 | _todo = todo; | 25 | _todo = todo; |
25 | setText( 0, todo->toShortText() ); | 26 | setText( 0, todo->toShortText() ); |
26 | setIcon(); | 27 | setIcon(); |
27 | } | 28 | } |
28 | 29 | ||
29 | TodoItem::~TodoItem() | 30 | TodoItem::~TodoItem() |
30 | { | 31 | { |
31 | delete _todo; | 32 | delete _todo; |
32 | } | 33 | } |
33 | 34 | ||
34 | QString TodoItem::toRichText() | 35 | QString TodoItem::toRichText() |
35 | { | 36 | { |
36 | return _todo->toRichText(); | 37 | return _todo->toRichText(); |
37 | } | 38 | } |
38 | 39 | ||
39 | void TodoItem::action( int act ) | 40 | void TodoItem::action( int act ) |
40 | { | 41 | { |
41 | if (act == 0){ | 42 | if (act == 0){ |
42 | QCopEnvelope e("QPE/Application/todolist", "show(int)"); | 43 | QCopEnvelope e("QPE/Application/todolist", "show(int)"); |
43 | e << _todo->uid(); | 44 | e << _todo->uid(); |
44 | }else if (act == 1){ | 45 | }else if (act == 1){ |
45 | QCopEnvelope e("QPE/Application/todolist", "edit(int)"); | 46 | QCopEnvelope e("QPE/Application/todolist", "edit(int)"); |
46 | e << _todo->uid(); | 47 | e << _todo->uid(); |
47 | } | 48 | } |
48 | } | 49 | } |
49 | 50 | ||
50 | QIntDict<QString> TodoItem::actions() | 51 | QIntDict<QString> TodoItem::actions() |
51 | { | 52 | { |
52 | QIntDict<QString> result; | 53 | QIntDict<QString> result; |
53 | result.insert( 0, new QString( QObject::tr("show") ) ); | 54 | result.insert( 0, new QString( QObject::tr("show") ) ); |
54 | result.insert( 1, new QString( QObject::tr("edit") ) ); | 55 | result.insert( 1, new QString( QObject::tr("edit") ) ); |
55 | return result; | 56 | return result; |
56 | } | 57 | } |
57 | 58 | ||
58 | void TodoItem::setIcon() | 59 | void TodoItem::setIcon() |
59 | { | 60 | { |
60 | QPixmap icon; | 61 | QPixmap icon; |
61 | switch ( _todo->lastHitField() ) { | 62 | switch ( _todo->lastHitField() ) { |
62 | case -1: | 63 | case -1: |
63 | icon = Resource::loadPixmap( "reset" ); | 64 | icon = Resource::loadPixmap( "reset" ); |
64 | break; | 65 | break; |
65 | case OPimTodo::Description: | 66 | case OPimTodo::Description: |
66 | icon = Resource::loadPixmap( "txt" ); | 67 | icon = Resource::loadPixmap( "txt" ); |
67 | break; | 68 | break; |
68 | case OPimTodo::Summary: | 69 | case OPimTodo::Summary: |
69 | icon = Resource::loadPixmap( "osearch/summary" ); | 70 | icon = Resource::loadPixmap( "osearch/summary" ); |
70 | break; | 71 | break; |
71 | case OPimTodo::Priority: | 72 | case OPimTodo::Priority: |
72 | icon = Resource::loadPixmap( "todo/priority1" ); | 73 | icon = Resource::loadPixmap( "todo/priority1" ); |
73 | break; | 74 | break; |
74 | case OPimTodo::HasDate: | 75 | case OPimTodo::HasDate: |
75 | icon = Resource::loadPixmap( "osearch/clock" ); | 76 | icon = Resource::loadPixmap( "osearch/clock" ); |
76 | break; | 77 | break; |
77 | default: | 78 | default: |
78 | icon = Resource::loadPixmap( "DocsIcon" ); | 79 | icon = Resource::loadPixmap( "DocsIcon" ); |
79 | break; | 80 | break; |
80 | } | 81 | } |
81 | setPixmap( 0, icon ); | 82 | setPixmap( 0, icon ); |
82 | } | 83 | } |