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 @@ -10,20 +10,23 @@ // Copyright: See COPYING file that comes with this distribution // // #include "eventitem.h" #include <qdatetime.h> +#include <qpixmap.h> +#include <qpe/resource.h> #include <qpe/qcopenvelope_qws.h> #include <opie/oevent.h> EventItem::EventItem(OListViewItem* parent, OEvent *event) : ResultItem(parent) { _event = event; setText(0, _event->toShortText() ); + setIcon(); } EventItem::~EventItem() { } @@ -49,6 +52,31 @@ QIntDict<QString> EventItem::actions() { QIntDict<QString> result; result.insert( 0, new QString( QObject::tr("show") ) ); result.insert( 1, new QString( QObject::tr("edit") ) ); 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 ); +} |