-rw-r--r-- | core/pim/osearch/todoitem.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/pim/osearch/todoitem.cpp b/core/pim/osearch/todoitem.cpp index 8b354f1..de4ea97 100644 --- a/core/pim/osearch/todoitem.cpp +++ b/core/pim/osearch/todoitem.cpp | |||
@@ -10,19 +10,22 @@ | |||
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 | #include <opie/otodo.h> |
16 | #include <qpixmap.h> | ||
17 | #include <qpe/resource.h> | ||
16 | #include <qpe/qcopenvelope_qws.h> | 18 | #include <qpe/qcopenvelope_qws.h> |
17 | 19 | ||
18 | TodoItem::TodoItem(OListViewItem* parent, OTodo *todo) | 20 | TodoItem::TodoItem(OListViewItem* parent, OTodo *todo) |
19 | : ResultItem(parent) | 21 | : ResultItem(parent) |
20 | { | 22 | { |
21 | _todo = todo; | 23 | _todo = todo; |
22 | setText( 0, todo->toShortText() ); | 24 | setText( 0, todo->toShortText() ); |
25 | setIcon(); | ||
23 | } | 26 | } |
24 | 27 | ||
25 | TodoItem::~TodoItem() | 28 | TodoItem::~TodoItem() |
26 | { | 29 | { |
27 | delete _todo; | 30 | delete _todo; |
28 | } | 31 | } |
@@ -47,6 +50,30 @@ QIntDict<QString> TodoItem::actions() | |||
47 | { | 50 | { |
48 | QIntDict<QString> result; | 51 | QIntDict<QString> result; |
49 | result.insert( 0, new QString( QObject::tr("show") ) ); | 52 | result.insert( 0, new QString( QObject::tr("show") ) ); |
50 | result.insert( 1, new QString( QObject::tr("edit") ) ); | 53 | result.insert( 1, new QString( QObject::tr("edit") ) ); |
51 | return result; | 54 | return result; |
52 | } | 55 | } |
56 | |||
57 | void TodoItem::setIcon() | ||
58 | { | ||
59 | QPixmap icon; | ||
60 | switch ( _todo->lastHitField() ) { | ||
61 | case -1: | ||
62 | icon = Resource::loadPixmap( "reset" ); | ||
63 | break; | ||
64 | case OTodo::Description: | ||
65 | case OTodo::Summary: | ||
66 | icon = Resource::loadPixmap( "osearch/personal" ); | ||
67 | break; | ||
68 | case OTodo::Priority: | ||
69 | icon = Resource::loadPixmap( "todo/priority1" ); | ||
70 | break; | ||
71 | case OTodo::HasDate: | ||
72 | icon = Resource::loadPixmap( "osearch/clock" ); | ||
73 | break; | ||
74 | default: | ||
75 | icon = Resource::loadPixmap( "DocsIcon" ); | ||
76 | break; | ||
77 | } | ||
78 | setPixmap( 0, icon ); | ||
79 | } | ||