summaryrefslogtreecommitdiff
path: root/core/pim/osearch/todoitem.cpp
authortille <tille>2003-05-14 15:25:08 (UTC)
committer tille <tille>2003-05-14 15:25:08 (UTC)
commit0042c63bd72905598928621e6e849cd6303ddf27 (patch) (side-by-side diff)
treef56dc5935cc9a4ec0d4df46d219fd7fc29fe1526 /core/pim/osearch/todoitem.cpp
parentdbda71abdc7c13ac0acde21320ee00726d95dec4 (diff)
downloadopie-0042c63bd72905598928621e6e849cd6303ddf27.zip
opie-0042c63bd72905598928621e6e849cd6303ddf27.tar.gz
opie-0042c63bd72905598928621e6e849cd6303ddf27.tar.bz2
icons for todo, contact and event results indication the matching field
Diffstat (limited to 'core/pim/osearch/todoitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/todoitem.cpp27
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
@@ -10,19 +10,22 @@
// Copyright: See COPYING file that comes with this distribution
//
//
#include "todoitem.h"
#include <opie/otodo.h>
+#include <qpixmap.h>
+#include <qpe/resource.h>
#include <qpe/qcopenvelope_qws.h>
TodoItem::TodoItem(OListViewItem* parent, OTodo *todo)
: ResultItem(parent)
{
_todo = todo;
setText( 0, todo->toShortText() );
+ setIcon();
}
TodoItem::~TodoItem()
{
delete _todo;
}
@@ -47,6 +50,30 @@ QIntDict<QString> TodoItem::actions()
{
QIntDict<QString> result;
result.insert( 0, new QString( QObject::tr("show") ) );
result.insert( 1, new QString( QObject::tr("edit") ) );
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 );
+}