-rw-r--r-- | core/pim/osearch/adresssearch.cpp | 4 | ||||
-rw-r--r-- | core/pim/osearch/contactitem.cpp | 2 | ||||
-rw-r--r-- | core/pim/osearch/datebooksearch.cpp | 16 | ||||
-rw-r--r-- | core/pim/osearch/eventitem.cpp | 2 | ||||
-rw-r--r-- | core/pim/osearch/todoitem.cpp | 16 | ||||
-rw-r--r-- | core/pim/osearch/todoitem.h | 3 | ||||
-rw-r--r-- | core/pim/osearch/todosearch.cpp | 12 | ||||
-rw-r--r-- | core/pim/osearch/todosearch.h | 2 |
8 files changed, 41 insertions, 16 deletions
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 @@ -24,24 +24,20 @@ AdressSearch::AdressSearch(QListView* parent, QString name): } AdressSearch::~AdressSearch() { delete _contacts; } void AdressSearch::expand() { SearchGroup::expand(); if (_search.isEmpty()) return; if (!_contacts) _contacts = new OContactAccess("osearch"); ORecordList<OContact> 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 @@ -5,31 +5,31 @@ // Description: // // // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 // // Copyright: See COPYING file that comes with this distribution // // #include "contactitem.h" #include <opie/ocontact.h> ContactItem::ContactItem(OListViewItem* parent, OContact *contact) : ResultItem(parent) { _contact = contact; - setText(0, _contact->fullName()); + setText(0, _contact->toShortText()); } ContactItem::~ContactItem() { delete _contact; } QString ContactItem::toRichText() { return _contact->toRichText(); } 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 @@ -24,36 +24,40 @@ DatebookSearch::DatebookSearch(QListView* parent, QString name) } DatebookSearch::~DatebookSearch() { delete _dates; } void DatebookSearch::expand() { SearchGroup::expand(); if (!_dates){ _dates = new ODateBookAccess(); _dates->load(); } - +#define LIPBOPIE_SEARCH +#ifdef LIPBOPIE_SEARCH + ORecordList<OEvent> results = _dates->matchRegexp(_search); + for (uint i = 0; i < results.count(); i++) { + new EventItem( this, new OEvent( results[i] )); + } +#else ORecordList<OEvent> list = _dates->allRecords(); QArray<int> m_currentQuery( list.count() ); for( uint i=0; i<list.count(); i++ ){ - + //qDebug("datebook: %s",list[i].description().latin1() ); if ( ( list[i].description().contains( _search ) ) || ( list[i].note().contains( _search ) ) || ( list[i].location().contains( _search ) ) -// ( _search.find( list[i].description(), 0 ) > 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 @@ -6,33 +6,33 @@ // // // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 // // Copyright: See COPYING file that comes with this distribution // // #include "eventitem.h" #include <qpe/qcopenvelope_qws.h> #include <opie/oevent.h> EventItem::EventItem(OListViewItem* parent, OEvent *event) : ResultItem(parent) { _event = event; - setText(0, _event->description() ); + setText(0, _event->toShortText() ); } EventItem::~EventItem() { } QString EventItem::toRichText() { return _event->toRichText(); } void EventItem::editItem() { QCopEnvelope e("QPE/Application/datebook", "editEvent(int)"); 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 @@ -1,40 +1,54 @@ // // // C++ Implementation: $MODULE$ // // Description: // // // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 // // Copyright: See COPYING file that comes with this distribution // // #include "todoitem.h" #include <opie/otodo.h> +#include <qpe/qcopenvelope_qws.h> TodoItem::TodoItem(OListViewItem* parent, OTodo *todo) : ResultItem(parent) { _todo = todo; - setText( 0, todo->summary() ); + setText( 0, todo->toShortText() ); } TodoItem::~TodoItem() { delete _todo; } void TodoItem::expand() { ResultItem::expand(); } 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 @@ -13,25 +13,26 @@ #ifndef TODOITEM_H #define TODOITEM_H #include "resultitem.h" class OTodo; /** @author Patrick S. Vogt */ class TodoItem : public ResultItem { public: TodoItem(OListViewItem* parent, OTodo *todo); ~TodoItem(); virtual void expand(); - //virtual int rtti() { return Result;} virtual QString toRichText(); + virtual void showItem(); + virtual void editItem(); private: OTodo *_todo; }; #endif 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 @@ -22,32 +22,42 @@ TodoSearch::TodoSearch(QListView* parent, QString name) : SearchGroup(parent, name) { //_fileName = QDir::homeDirPath()+"/Applications/todolist/todolist.xml"; _todos = 0; } TodoSearch::~TodoSearch() { delete _todos; } void TodoSearch::expand() { SearchGroup::expand(); + if (_search.isEmpty()) return; + if (!_todos){ _todos = new OTodoAccess(); _todos->load(); } + + ORecordList<OTodo> results = _todos->matchRegexp(_search); + for (uint i = 0; i < results.count(); i++) { + new TodoItem( this, new OTodo( results[i] )); + } +/* ORecordList<OTodo> list = _todos->allRecords(); QArray<int> m_currentQuery( list.count() ); for( uint i=0; i<list.count(); i++ ){ + // qDebug("todo: %s",list[i].summary().latin1() ); if ( list[i].match( _search ) ){ + // qDebug("FOUND"); new TodoItem( this, new OTodo( list[i] ) ); } - } + }*/ } diff --git a/core/pim/osearch/todosearch.h b/core/pim/osearch/todosearch.h index 33c1064..856be1f 100644 --- a/core/pim/osearch/todosearch.h +++ b/core/pim/osearch/todosearch.h @@ -1,32 +1,32 @@ // // // C++ Interface: $MODULE$ // // Description: // // // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 // // Copyright: See COPYING file that comes with this distribution // // #ifndef TODOSEARCH_H #define TODOSEARCH_H -#include "filesearch.h" +#include "searchgroup.h" class OTodoAccess; /** @author Patrick S. Vogt */ class TodoSearch : public SearchGroup { public: TodoSearch(QListView* parent, QString name); ~TodoSearch(); virtual void expand(); private: OTodoAccess *_todos; |