summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/datebooksearch.cpp3
-rw-r--r--core/pim/osearch/osearch.pro5
-rw-r--r--core/pim/osearch/searchgroup.h2
-rw-r--r--core/pim/osearch/todosearch.cpp6
4 files changed, 7 insertions, 9 deletions
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp
index e60a3b1..8f9d472 100644
--- a/core/pim/osearch/datebooksearch.cpp
+++ b/core/pim/osearch/datebooksearch.cpp
@@ -24,35 +24,34 @@ DatebookSearch::DatebookSearch(QListView* parent, QString name)
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#define LIPBOPIE_SEARCH
41#ifdef LIPBOPIE_SEARCH 40#ifdef LIPBOPIE_SEARCH
42 ORecordList<OEvent> results = _dates->matchRegexp(_search); 41 ORecordList<OEvent> results = _dates->matchRegexp(_search);
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 45#else
47 ORecordList<OEvent> list = _dates->allRecords(); 46 ORecordList<OEvent> list = _dates->allRecords();
48 QArray<int> m_currentQuery( list.count() ); 47 QArray<int> m_currentQuery( list.count() );
49 for( uint i=0; i<list.count(); i++ ){ 48 for( uint i=0; i<list.count(); i++ ){
50 //qDebug("datebook: %s",list[i].description().latin1() ); 49 //qDebug("datebook: %s",list[i].description().latin1() );
51 if ( 50 if (
52 ( list[i].description().contains( _search ) ) || 51 ( list[i].description().contains( _search ) ) ||
53 ( list[i].note().contains( _search ) ) || 52 ( list[i].note().contains( _search ) ) ||
54 ( list[i].location().contains( _search ) ) 53 ( list[i].location().contains( _search ) )
55 ){ 54 ){
56 //qDebug("FOUND"); 55 //qDebug("FOUND");
57 new EventItem( this, new OEvent( list[i] ) ); 56 new EventItem( this, new OEvent( list[i] ) );
58 } 57 }
diff --git a/core/pim/osearch/osearch.pro b/core/pim/osearch/osearch.pro
index 996eb53..397bc83 100644
--- a/core/pim/osearch/osearch.pro
+++ b/core/pim/osearch/osearch.pro
@@ -1,21 +1,16 @@
1# File generated by kdevelop's qmake manager.
2# -------------------------------------------
3# Subdir relative project main directory: .
4# Target is an application: osearch
5
6DEPENDPATH += $(OPIEDIR)/ioclude 1DEPENDPATH += $(OPIEDIR)/ioclude
7LIBS += -lqpe -lopie 2LIBS += -lqpe -lopie
8INTERFACES = 3INTERFACES =
9include ( $(OPIEDIR)/include.pro ) 4include ( $(OPIEDIR)/include.pro )
10TEMPLATE = app 5TEMPLATE = app
11CONFIG += debug warn_on qt 6CONFIG += debug warn_on qt
12DESTDIR = $(OPIEDIR)/bin 7DESTDIR = $(OPIEDIR)/bin
13TARGET = osearch 8TARGET = osearch
14INCLUDEPATH = $(OPIEDIR)/include 9INCLUDEPATH = $(OPIEDIR)/include
15SOURCES += main.cpp \ 10SOURCES += main.cpp \
16 mainwindow.cpp \ 11 mainwindow.cpp \
17 olistview.cpp \ 12 olistview.cpp \
18 olistviewitem.cpp \ 13 olistviewitem.cpp \
19 adresssearch.cpp \ 14 adresssearch.cpp \
20 todosearch.cpp \ 15 todosearch.cpp \
21 datebooksearch.cpp \ 16 datebooksearch.cpp \
diff --git a/core/pim/osearch/searchgroup.h b/core/pim/osearch/searchgroup.h
index d26ff17..6b6bbf5 100644
--- a/core/pim/osearch/searchgroup.h
+++ b/core/pim/osearch/searchgroup.h
@@ -4,32 +4,34 @@
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 19
20//#define LIPBOPIE_SEARCH
21
20/** 22/**
21@author Patrick S. Vogt 23@author Patrick S. Vogt
22*/ 24*/
23class SearchGroup : public OListViewItem 25class SearchGroup : public OListViewItem
24{ 26{
25public: 27public:
26 SearchGroup(QListView* parent, QString name); 28 SearchGroup(QListView* parent, QString name);
27 29
28 ~SearchGroup(); 30 ~SearchGroup();
29 31
30 virtual void expand(); 32 virtual void expand();
31 virtual void setSearch(QString); 33 virtual void setSearch(QString);
32 virtual void setSearch(QRegExp); 34 virtual void setSearch(QRegExp);
33 virtual int rtti() { return Searchgroup;} 35 virtual int rtti() { return Searchgroup;}
34 36
35protected: 37protected:
diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp
index 82fae8d..9a22ee1 100644
--- a/core/pim/osearch/todosearch.cpp
+++ b/core/pim/osearch/todosearch.cpp
@@ -29,35 +29,37 @@ TodoSearch::TodoSearch(QListView* parent, QString name)
29TodoSearch::~TodoSearch() 29TodoSearch::~TodoSearch()
30{ 30{
31 delete _todos; 31 delete _todos;
32} 32}
33 33
34 34
35void TodoSearch::expand() 35void TodoSearch::expand()
36{ 36{
37 SearchGroup::expand(); 37 SearchGroup::expand();
38 if (_search.isEmpty()) return; 38 if (_search.isEmpty()) return;
39 39
40 if (!_todos){ 40 if (!_todos){
41 _todos = new OTodoAccess(); 41 _todos = new OTodoAccess();
42 _todos->load(); 42 _todos->load();
43 } 43 }
44 44
45#ifdef LIPBOPIE_SEARCH
45 ORecordList<OTodo> results = _todos->matchRegexp(_search); 46 ORecordList<OTodo> results = _todos->matchRegexp(_search);
46 for (uint i = 0; i < results.count(); i++) { 47 for (uint i = 0; i < results.count(); i++) {
47 new TodoItem( this, new OTodo( results[i] )); 48 new TodoItem( this, new OTodo( results[i] ));
48 } 49 }
49/* 50#else
50 ORecordList<OTodo> list = _todos->allRecords(); 51 ORecordList<OTodo> list = _todos->allRecords();
51 QArray<int> m_currentQuery( list.count() ); 52 QArray<int> m_currentQuery( list.count() );
52 for( uint i=0; i<list.count(); i++ ){ 53 for( uint i=0; i<list.count(); i++ ){
53 // qDebug("todo: %s",list[i].summary().latin1() ); 54 // qDebug("todo: %s",list[i].summary().latin1() );
54 if ( list[i].match( _search ) ){ 55 if ( list[i].match( _search ) ){
55 // qDebug("FOUND"); 56 // qDebug("FOUND");
56 new TodoItem( this, new OTodo( list[i] ) ); 57 new TodoItem( this, new OTodo( list[i] ) );
57 } 58 }
58 59
59 }*/ 60 }
61#endif
60 62
61} 63}
62 64
63 65