Diffstat (limited to 'core/pim/osearch/eventitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/eventitem.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/pim/osearch/eventitem.cpp b/core/pim/osearch/eventitem.cpp index 3b84b42..5b7a840 100644 --- a/core/pim/osearch/eventitem.cpp +++ b/core/pim/osearch/eventitem.cpp @@ -15,2 +15,4 @@ #include <qdatetime.h> +#include <qpixmap.h> +#include <qpe/resource.h> #include <qpe/qcopenvelope_qws.h> @@ -23,2 +25,3 @@ EventItem::EventItem(OListViewItem* parent, OEvent *event) setText(0, _event->toShortText() ); + setIcon(); } @@ -54 +57,26 @@ QIntDict<QString> EventItem::actions() } + +void EventItem::setIcon() +{ + QPixmap icon; + switch ( _event->lastHitField() ) { + case -1: + icon = Resource::loadPixmap( "reset" ); + break; + case Qtopia::DatebookDescription: + case Qtopia::Notes: + icon = Resource::loadPixmap( "osearch/personal" ); + break; + case Qtopia::Location: + icon = Resource::loadPixmap( "home" ); + break; + case Qtopia::StartDateTime: + case Qtopia::EndDateTime: + icon = Resource::loadPixmap( "osearch/clock" ); + break; + default: + icon = Resource::loadPixmap( "DocsIcon" ); + break; + } + setPixmap( 0, icon ); +} |