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