From 763d7d7da84682fb87a631a997e93c08f5abde61 Mon Sep 17 00:00:00 2001 From: tille Date: Thu, 08 May 2003 12:16:38 +0000 Subject: this needs the new libopie patch... --- (limited to 'core/pim') diff --git a/core/pim/osearch/adresssearch.cpp b/core/pim/osearch/adresssearch.cpp index 4b0bd9c..c5b1ae7 100644 --- a/core/pim/osearch/adresssearch.cpp +++ b/core/pim/osearch/adresssearch.cpp @@ -37,10 +37,6 @@ void AdressSearch::expand() if (!_contacts) _contacts = new OContactAccess("osearch"); ORecordList results = _contacts->matchRegexp(_search); for (uint i = 0; i < results.count(); i++) { -// qDebug("i=%i",i); -// OContact rec = results[i]; -// qDebug("fullname %s",rec.fullName().latin1()); -//(( new OListViewItem( this, rec.fullName() ); new ContactItem( this, new OContact( results[i] )); } } diff --git a/core/pim/osearch/contactitem.cpp b/core/pim/osearch/contactitem.cpp index 36e4f00..86879aa 100644 --- a/core/pim/osearch/contactitem.cpp +++ b/core/pim/osearch/contactitem.cpp @@ -18,7 +18,7 @@ ContactItem::ContactItem(OListViewItem* parent, OContact *contact) : ResultItem(parent) { _contact = contact; - setText(0, _contact->fullName()); + setText(0, _contact->toShortText()); } diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp index 85c55c2..e60a3b1 100644 --- a/core/pim/osearch/datebooksearch.cpp +++ b/core/pim/osearch/datebooksearch.cpp @@ -37,23 +37,27 @@ void DatebookSearch::expand() _dates = new ODateBookAccess(); _dates->load(); } - +#define LIPBOPIE_SEARCH +#ifdef LIPBOPIE_SEARCH + ORecordList results = _dates->matchRegexp(_search); + for (uint i = 0; i < results.count(); i++) { + new EventItem( this, new OEvent( results[i] )); + } +#else ORecordList list = _dates->allRecords(); QArray m_currentQuery( list.count() ); for( uint i=0; i 0 ) || -// ( _search.find( list[i].note(), 0 ) > 0 ) || -// ( _search.find( list[i].location(), 0 ) > 0 ) ){ + //qDebug("FOUND"); new EventItem( this, new OEvent( list[i] ) ); -// new OListViewItem( this, list[i].description() ); } } +#endif } diff --git a/core/pim/osearch/eventitem.cpp b/core/pim/osearch/eventitem.cpp index 516a274..bf5b2b9 100644 --- a/core/pim/osearch/eventitem.cpp +++ b/core/pim/osearch/eventitem.cpp @@ -19,7 +19,7 @@ EventItem::EventItem(OListViewItem* parent, OEvent *event) : ResultItem(parent) { _event = event; - setText(0, _event->description() ); + setText(0, _event->toShortText() ); } @@ -37,4 +37,4 @@ void EventItem::editItem() { QCopEnvelope e("QPE/Application/datebook", "editEvent(int)"); e << _event->uid(); -} \ No newline at end of file +} diff --git a/core/pim/osearch/todoitem.cpp b/core/pim/osearch/todoitem.cpp index 422a6d8..4ea4586 100644 --- a/core/pim/osearch/todoitem.cpp +++ b/core/pim/osearch/todoitem.cpp @@ -13,12 +13,13 @@ #include "todoitem.h" #include +#include TodoItem::TodoItem(OListViewItem* parent, OTodo *todo) : ResultItem(parent) { _todo = todo; - setText( 0, todo->summary() ); + setText( 0, todo->toShortText() ); } @@ -38,3 +39,16 @@ QString TodoItem::toRichText() return _todo->toRichText(); } +void TodoItem::showItem() +{ +// QCopEnvelope e("QPE/Todolist", "show(int)"); + qDebug("calling todolist for %i",_todo->uid()); + QCopEnvelope e("QPE/Todolist", "show(int)"); + e << _todo->uid(); +} + +void TodoItem::editItem() +{ + QCopEnvelope e("QPE/Todolist", "edit(int)"); + e << _todo->uid(); +} diff --git a/core/pim/osearch/todoitem.h b/core/pim/osearch/todoitem.h index 1196c68..6f34915 100644 --- a/core/pim/osearch/todoitem.h +++ b/core/pim/osearch/todoitem.h @@ -26,8 +26,9 @@ public: ~TodoItem(); virtual void expand(); - //virtual int rtti() { return Result;} virtual QString toRichText(); + virtual void showItem(); + virtual void editItem(); private: OTodo *_todo; diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp index e34c384..82fae8d 100644 --- a/core/pim/osearch/todosearch.cpp +++ b/core/pim/osearch/todosearch.cpp @@ -35,18 +35,28 @@ TodoSearch::~TodoSearch() void TodoSearch::expand() { SearchGroup::expand(); - if (!_todos){ + if (_search.isEmpty()) return; + + if (!_todos){ _todos = new OTodoAccess(); _todos->load(); } + + ORecordList results = _todos->matchRegexp(_search); + for (uint i = 0; i < results.count(); i++) { + new TodoItem( this, new OTodo( results[i] )); + } +/* ORecordList list = _todos->allRecords(); QArray m_currentQuery( list.count() ); for( uint i=0; i