summaryrefslogtreecommitdiff
path: root/core/pim/osearch
authortille <tille>2003-05-08 12:16:38 (UTC)
committer tille <tille>2003-05-08 12:16:38 (UTC)
commit763d7d7da84682fb87a631a997e93c08f5abde61 (patch) (side-by-side diff)
tree9cfeb731b793e3634fa751a6b6ffce63609f24a2 /core/pim/osearch
parent9e08dd00a96ffb4141da9f4ce2df0b871b334691 (diff)
downloadopie-763d7d7da84682fb87a631a997e93c08f5abde61.zip
opie-763d7d7da84682fb87a631a997e93c08f5abde61.tar.gz
opie-763d7d7da84682fb87a631a997e93c08f5abde61.tar.bz2
this needs the new libopie patch...
Diffstat (limited to 'core/pim/osearch') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/adresssearch.cpp4
-rw-r--r--core/pim/osearch/contactitem.cpp2
-rw-r--r--core/pim/osearch/datebooksearch.cpp16
-rw-r--r--core/pim/osearch/eventitem.cpp4
-rw-r--r--core/pim/osearch/todoitem.cpp16
-rw-r--r--core/pim/osearch/todoitem.h3
-rw-r--r--core/pim/osearch/todosearch.cpp14
-rw-r--r--core/pim/osearch/todosearch.h2
8 files changed, 43 insertions, 18 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
@@ -39,6 +39,2 @@ void AdressSearch::expand()
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
@@ -20,3 +20,3 @@ ContactItem::ContactItem(OListViewItem* parent, OContact *contact)
_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
@@ -39,3 +39,9 @@ void DatebookSearch::expand()
}
-
+#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();
@@ -43,3 +49,3 @@ void DatebookSearch::expand()
for( uint i=0; i<list.count(); i++ ){
-
+ //qDebug("datebook: %s",list[i].description().latin1() );
if (
@@ -48,8 +54,5 @@ void DatebookSearch::expand()
( 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() );
}
@@ -57,2 +60,3 @@ void DatebookSearch::expand()
}
+#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
@@ -21,3 +21,3 @@ EventItem::EventItem(OListViewItem* parent, OEvent *event)
_event = event;
- setText(0, _event->description() );
+ setText(0, _event->toShortText() );
}
@@ -39,2 +39,2 @@ void EventItem::editItem()
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
@@ -15,2 +15,3 @@
#include <opie/otodo.h>
+#include <qpe/qcopenvelope_qws.h>
@@ -20,3 +21,3 @@ TodoItem::TodoItem(OListViewItem* parent, OTodo *todo)
_todo = todo;
- setText( 0, todo->summary() );
+ setText( 0, todo->toShortText() );
}
@@ -40 +41,14 @@ QString TodoItem::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
@@ -28,4 +28,5 @@ public:
virtual void expand();
- //virtual int rtti() { return Result;}
virtual QString toRichText();
+ virtual void showItem();
+ virtual void editItem();
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
@@ -37,3 +37,5 @@ void TodoSearch::expand()
SearchGroup::expand();
- if (!_todos){
+ if (_search.isEmpty()) return;
+
+ if (!_todos){
_todos = new OTodoAccess();
@@ -41,2 +43,8 @@ void TodoSearch::expand()
}
+
+ 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();
@@ -44,3 +52,5 @@ void TodoSearch::expand()
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] ) );
@@ -48,3 +58,3 @@ void TodoSearch::expand()
- }
+ }*/
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
@@ -15,3 +15,3 @@
-#include "filesearch.h"
+#include "searchgroup.h"