summaryrefslogtreecommitdiff
authortille <tille>2003-05-10 12:37:35 (UTC)
committer tille <tille>2003-05-10 12:37:35 (UTC)
commit882b5190d02c33aa8c893e8aa54bf3d38ac255c8 (patch) (unidiff)
treec79bf2a664d780013b685dd9617829cecdea3561
parent65efa1e8a846f92580155d6ce7e28fe9b7ae19d2 (diff)
downloadopie-882b5190d02c33aa8c893e8aa54bf3d38ac255c8.zip
opie-882b5190d02c33aa8c893e8aa54bf3d38ac255c8.tar.gz
opie-882b5190d02c33aa8c893e8aa54bf3d38ac255c8.tar.bz2
clean up
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
@@ -29,23 +29,23 @@ ContactItem::~ContactItem()
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
@@ -28,36 +28,19 @@ DatebookSearch::~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
@@ -7,25 +7,24 @@
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();
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
@@ -33,22 +33,22 @@ void 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
@@ -5,62 +5,47 @@
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