-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 @@ -14,4 +14,6 @@ #include <opie/otodo.h> +#include <qpixmap.h> +#include <qpe/resource.h> #include <qpe/qcopenvelope_qws.h> @@ -21,4 +23,5 @@ TodoItem::TodoItem(OListViewItem* parent, OTodo *todo) _todo = todo; setText( 0, todo->toShortText() ); + setIcon(); } @@ -51,2 +54,26 @@ QIntDict<QString> TodoItem::actions() return result; } + +void TodoItem::setIcon() +{ + QPixmap icon; + switch ( _todo->lastHitField() ) { + case -1: + icon = Resource::loadPixmap( "reset" ); + break; + case OTodo::Description: + case OTodo::Summary: + icon = Resource::loadPixmap( "osearch/personal" ); + break; + case OTodo::Priority: + icon = Resource::loadPixmap( "todo/priority1" ); + break; + case OTodo::HasDate: + icon = Resource::loadPixmap( "osearch/clock" ); + break; + default: + icon = Resource::loadPixmap( "DocsIcon" ); + break; + } + setPixmap( 0, icon ); +} |