summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/contactitem.cpp4
-rw-r--r--core/pim/osearch/datebooksearch.cpp17
-rw-r--r--core/pim/osearch/searchgroup.h1
-rw-r--r--core/pim/osearch/todoitem.cpp6
-rw-r--r--core/pim/osearch/todosearch.cpp15
5 files changed, 5 insertions, 38 deletions
diff --git a/core/pim/osearch/contactitem.cpp b/core/pim/osearch/contactitem.cpp
index 29d81be..788a415 100644
--- a/core/pim/osearch/contactitem.cpp
+++ b/core/pim/osearch/contactitem.cpp
@@ -9,43 +9,43 @@
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "contactitem.h" 13#include "contactitem.h"
14 14
15#include <opie/ocontact.h> 15#include <opie/ocontact.h>
16#include <qpe/qcopenvelope_qws.h> 16#include <qpe/qcopenvelope_qws.h>
17 17
18ContactItem::ContactItem(OListViewItem* parent, OContact *contact) 18ContactItem::ContactItem(OListViewItem* parent, OContact *contact)
19: ResultItem(parent) 19: ResultItem(parent)
20{ 20{
21 _contact = contact; 21 _contact = contact;
22 setText(0, _contact->toShortText()); 22 setText(0, _contact->toShortText());
23} 23}
24 24
25 25
26ContactItem::~ContactItem() 26ContactItem::~ContactItem()
27{ 27{
28 delete _contact; 28 delete _contact;
29} 29}
30 30
31 31
32QString ContactItem::toRichText() 32QString ContactItem::toRichText()
33{ 33{
34 return _contact->toRichText(); 34 return _contact->toRichText();
35} 35}
36 36
37 37
38void ContactItem::editItem() 38void ContactItem::editItem()
39{ 39{
40 QCopEnvelope e("QPE/Application/addressbook", "edit(int)"); 40 QCopEnvelope e("QPE/Application/addressbook", "edit(int)");
41 //QCopEnvelope e("QPE/Addressbook", "editEvent(int)"); 41 //QCopEnvelope e("QPE/Addressbook", "edit(int)");
42 e << _contact->uid(); 42 e << _contact->uid();
43} 43}
44 44
45void ContactItem::showItem() 45void ContactItem::showItem()
46{ 46{
47 QCopEnvelope e("QPE/Application/addressbook", "show(int)"); 47 QCopEnvelope e("QPE/Application/addressbook", "show(int)");
48 //QCopEnvelope e("QPE/Addressbook", "viewDefault(QDate)"); 48 //QCopEnvelope e("QPE/Addressbook", "show(int)");
49 e << _contact->uid(); 49 e << _contact->uid();
50} 50}
51 51
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp
index 0590252..83b99f5 100644
--- a/core/pim/osearch/datebooksearch.cpp
+++ b/core/pim/osearch/datebooksearch.cpp
@@ -8,56 +8,39 @@
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "datebooksearch.h" 13#include "datebooksearch.h"
14 14
15#include "eventitem.h" 15#include "eventitem.h"
16 16
17#include <opie/oevent.h> 17#include <opie/oevent.h>
18#include <opie/odatebookaccess.h> 18#include <opie/odatebookaccess.h>
19 19
20DatebookSearch::DatebookSearch(QListView* parent, QString name) 20DatebookSearch::DatebookSearch(QListView* parent, QString name)
21: SearchGroup(parent, name) 21: SearchGroup(parent, name)
22{ 22{
23 _dates = 0; 23 _dates = 0;
24} 24}
25 25
26 26
27DatebookSearch::~DatebookSearch() 27DatebookSearch::~DatebookSearch()
28{ 28{
29 delete _dates; 29 delete _dates;
30} 30}
31 31
32 32
33void DatebookSearch::expand() 33void DatebookSearch::expand()
34{ 34{
35 SearchGroup::expand(); 35 SearchGroup::expand();
36 if (!_dates){ 36 if (!_dates){
37 _dates = new ODateBookAccess(); 37 _dates = new ODateBookAccess();
38 _dates->load(); 38 _dates->load();
39 } 39 }
40#ifdef LIPBOPIE_SEARCH
41 ORecordList<OEvent> results = _dates->matchRegexp(_search); 40 ORecordList<OEvent> results = _dates->matchRegexp(_search);
42 setText(0, text(0) + " (" + QString::number( results.count() ) + ")" ); 41 setText(0, text(0) + " (" + QString::number( results.count() ) + ")" );
43 for (uint i = 0; i < results.count(); i++) { 42 for (uint i = 0; i < results.count(); i++) {
44 new EventItem( this, new OEvent( results[i] )); 43 new EventItem( this, new OEvent( results[i] ));
45 } 44 }
46#else
47 ORecordList<OEvent> list = _dates->allRecords();
48 QArray<int> m_currentQuery( list.count() );
49 for( uint i=0; i<list.count(); i++ ){
50 //qDebug("datebook: %s",list[i].description().latin1() );
51 if (
52 ( list[i].description().contains( _search ) ) ||
53 ( list[i].note().contains( _search ) ) ||
54 ( list[i].location().contains( _search ) )
55 ){
56 //qDebug("FOUND");
57 new EventItem( this, new OEvent( list[i] ) );
58 }
59
60 }
61#endif
62} 45}
63 46
diff --git a/core/pim/osearch/searchgroup.h b/core/pim/osearch/searchgroup.h
index 4195e6f..d26ff17 100644
--- a/core/pim/osearch/searchgroup.h
+++ b/core/pim/osearch/searchgroup.h
@@ -1,43 +1,42 @@
1// 1//
2// 2//
3// C++ Interface: $MODULE$ 3// C++ Interface: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#ifndef SEARCHGROUP_H 13#ifndef SEARCHGROUP_H
14#define SEARCHGROUP_H 14#define SEARCHGROUP_H
15 15
16#include "olistviewitem.h" 16#include "olistviewitem.h"
17 17
18#include <qregexp.h> 18#include <qregexp.h>
19#define LIPBOPIE_SEARCH
20 19
21/** 20/**
22@author Patrick S. Vogt 21@author Patrick S. Vogt
23*/ 22*/
24class SearchGroup : public OListViewItem 23class SearchGroup : public OListViewItem
25{ 24{
26public: 25public:
27 SearchGroup(QListView* parent, QString name); 26 SearchGroup(QListView* parent, QString name);
28 27
29 ~SearchGroup(); 28 ~SearchGroup();
30 29
31 virtual void expand(); 30 virtual void expand();
32 virtual void setSearch(QString); 31 virtual void setSearch(QString);
33 virtual void setSearch(QRegExp); 32 virtual void setSearch(QRegExp);
34 virtual int rtti() { return Searchgroup;} 33 virtual int rtti() { return Searchgroup;}
35 34
36protected: 35protected:
37 QRegExp _search; 36 QRegExp _search;
38private: 37private:
39 QString _name; 38 QString _name;
40 bool expanded; 39 bool expanded;
41}; 40};
42 41
43#endif 42#endif
diff --git a/core/pim/osearch/todoitem.cpp b/core/pim/osearch/todoitem.cpp
index 4ea4586..145b423 100644
--- a/core/pim/osearch/todoitem.cpp
+++ b/core/pim/osearch/todoitem.cpp
@@ -13,42 +13,42 @@
13#include "todoitem.h" 13#include "todoitem.h"
14 14
15#include <opie/otodo.h> 15#include <opie/otodo.h>
16#include <qpe/qcopenvelope_qws.h> 16#include <qpe/qcopenvelope_qws.h>
17 17
18TodoItem::TodoItem(OListViewItem* parent, OTodo *todo) 18TodoItem::TodoItem(OListViewItem* parent, OTodo *todo)
19: ResultItem(parent) 19: ResultItem(parent)
20{ 20{
21 _todo = todo; 21 _todo = todo;
22 setText( 0, todo->toShortText() ); 22 setText( 0, todo->toShortText() );
23} 23}
24 24
25 25
26TodoItem::~TodoItem() 26TodoItem::~TodoItem()
27{ 27{
28 delete _todo; 28 delete _todo;
29} 29}
30 30
31 31
32void TodoItem::expand() 32void TodoItem::expand()
33{ 33{
34 ResultItem::expand(); 34 ResultItem::expand();
35} 35}
36 36
37QString TodoItem::toRichText() 37QString TodoItem::toRichText()
38{ 38{
39 return _todo->toRichText(); 39 return _todo->toRichText();
40} 40}
41 41
42void TodoItem::showItem() 42void TodoItem::showItem()
43{ 43{
44 //QCopEnvelope e("QPE/Todolist", "show(int)"); 44 //QCopEnvelope e("QPE/Todolist", "show(int)");
45 qDebug("calling todolist for %i",_todo->uid()); 45 QCopEnvelope e("QPE/Application/todolist", "show(int)");
46 QCopEnvelope e("QPE/Todolist", "show(int)");
47 e << _todo->uid(); 46 e << _todo->uid();
48} 47}
49 48
50void TodoItem::editItem() 49void TodoItem::editItem()
51{ 50{
52 QCopEnvelope e("QPE/Todolist", "edit(int)"); 51 //QCopEnvelope e("QPE/Todolist", "edit(int)");
52 QCopEnvelope e("QPE/Application/todolist", "edit(int)");
53 e << _todo->uid(); 53 e << _todo->uid();
54} 54}
diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp
index fba8aa0..cbe356b 100644
--- a/core/pim/osearch/todosearch.cpp
+++ b/core/pim/osearch/todosearch.cpp
@@ -1,66 +1,51 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "todosearch.h" 13#include "todosearch.h"
14 14
15#include <opie/otodoaccess.h> 15#include <opie/otodoaccess.h>
16#include <opie/otodo.h> 16#include <opie/otodo.h>
17#include <qdir.h>
18 17
19#include "todoitem.h" 18#include "todoitem.h"
20 19
21TodoSearch::TodoSearch(QListView* parent, QString name) 20TodoSearch::TodoSearch(QListView* parent, QString name)
22: SearchGroup(parent, name) 21: SearchGroup(parent, name)
23{ 22{
24 //_fileName = QDir::homeDirPath()+"/Applications/todolist/todolist.xml";
25 _todos = 0; 23 _todos = 0;
26} 24}
27 25
28 26
29TodoSearch::~TodoSearch() 27TodoSearch::~TodoSearch()
30{ 28{
31 delete _todos; 29 delete _todos;
32} 30}
33 31
34 32
35void TodoSearch::expand() 33void TodoSearch::expand()
36{ 34{
37 SearchGroup::expand(); 35 SearchGroup::expand();
38 if (_search.isEmpty()) return; 36 if (_search.isEmpty()) return;
39 37
40 if (!_todos){ 38 if (!_todos){
41 _todos = new OTodoAccess(); 39 _todos = new OTodoAccess();
42 _todos->load(); 40 _todos->load();
43 } 41 }
44 42
45#ifdef LIPBOPIE_SEARCH
46 ORecordList<OTodo> results = _todos->matchRegexp(_search); 43 ORecordList<OTodo> results = _todos->matchRegexp(_search);
47 setText(0, text(0) + " (" + QString::number( results.count() ) + ")"); 44 setText(0, text(0) + " (" + QString::number( results.count() ) + ")");
48 for (uint i = 0; i < results.count(); i++) { 45 for (uint i = 0; i < results.count(); i++) {
49 new TodoItem( this, new OTodo( results[i] )); 46 new TodoItem( this, new OTodo( results[i] ));
50 } 47 }
51#else
52 ORecordList<OTodo> list = _todos->allRecords();
53 QArray<int> m_currentQuery( list.count() );
54 for( uint i=0; i<list.count(); i++ ){
55 // qDebug("todo: %s",list[i].summary().latin1() );
56 if ( list[i].match( _search ) ){
57 // qDebug("FOUND");
58 new TodoItem( this, new OTodo( list[i] ) );
59 }
60
61 }
62#endif
63 48
64} 49}
65 50
66 51