author | tille <tille> | 2003-05-14 15:25:08 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-14 15:25:08 (UTC) |
commit | 0042c63bd72905598928621e6e849cd6303ddf27 (patch) (unidiff) | |
tree | f56dc5935cc9a4ec0d4df46d219fd7fc29fe1526 /core/pim/osearch/todoitem.cpp | |
parent | dbda71abdc7c13ac0acde21320ee00726d95dec4 (diff) | |
download | opie-0042c63bd72905598928621e6e849cd6303ddf27.zip opie-0042c63bd72905598928621e6e849cd6303ddf27.tar.gz opie-0042c63bd72905598928621e6e849cd6303ddf27.tar.bz2 |
icons for todo, contact and event results indication the matching field
-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 | |||
@@ -13,6 +13,8 @@ | |||
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) |
@@ -20,6 +22,7 @@ TodoItem::TodoItem(OListViewItem* parent, OTodo *todo) | |||
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() |
@@ -50,3 +53,27 @@ QIntDict<QString> TodoItem::actions() | |||
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 | } | ||