summaryrefslogtreecommitdiff
Side-by-side diff
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
@@ -16,48 +16,47 @@
#include <opie/oevent.h>
#include <opie/odatebookaccess.h>
DatebookSearch::DatebookSearch(QListView* parent, QString name)
: SearchGroup(parent, name)
{
_dates = 0;
}
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);
+ 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 ) )
){
//qDebug("FOUND");
new EventItem( this, new OEvent( list[i] ) );
}
}
#endif
}
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,29 +1,24 @@
-# File generated by kdevelop's qmake manager.
-# -------------------------------------------
-# Subdir relative project main directory: .
-# Target is an application: osearch
-
DEPENDPATH += $(OPIEDIR)/ioclude
LIBS += -lqpe -lopie
INTERFACES =
include ( $(OPIEDIR)/include.pro )
TEMPLATE = app
CONFIG += debug warn_on qt
DESTDIR = $(OPIEDIR)/bin
TARGET = osearch
INCLUDEPATH = $(OPIEDIR)/include
SOURCES += main.cpp \
mainwindow.cpp \
olistview.cpp \
olistviewitem.cpp \
adresssearch.cpp \
todosearch.cpp \
datebooksearch.cpp \
searchgroup.cpp \
resultitem.cpp \
todoitem.cpp \
contactitem.cpp \
eventitem.cpp
HEADERS += mainwindow.h \
olistview.h \
olistviewitem.h \
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
@@ -1,42 +1,44 @@
//
//
// C++ Interface: $MODULE$
//
// Description:
//
//
// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef SEARCHGROUP_H
#define SEARCHGROUP_H
#include "olistviewitem.h"
#include <qregexp.h>
+//#define LIPBOPIE_SEARCH
+
/**
@author Patrick S. Vogt
*/
class SearchGroup : public OListViewItem
{
public:
SearchGroup(QListView* parent, QString name);
~SearchGroup();
virtual void expand();
virtual void setSearch(QString);
virtual void setSearch(QRegExp);
virtual int rtti() { return Searchgroup;}
protected:
QRegExp _search;
private:
QString _name;
bool expanded;
};
#endif
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
@@ -21,43 +21,45 @@
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();
}
+#ifdef LIPBOPIE_SEARCH
ORecordList<OTodo> results = _todos->matchRegexp(_search);
for (uint i = 0; i < results.count(); i++) {
new TodoItem( this, new OTodo( results[i] ));
}
-/*
+#else
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] ) );
}
- }*/
+ }
+#endif
}