Diffstat (limited to 'core/pim/osearch/eventitem.cpp') (more/less context) (show 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 @@ -14,4 +14,6 @@ #include <qdatetime.h> +#include <qpixmap.h> +#include <qpe/resource.h> #include <qpe/qcopenvelope_qws.h> #include <opie/oevent.h> @@ -22,4 +24,5 @@ EventItem::EventItem(OListViewItem* parent, OEvent *event) _event = event; setText(0, _event->toShortText() ); + setIcon(); } @@ -53,2 +56,27 @@ QIntDict<QString> EventItem::actions() return result; } + +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 ); +} |