author | tille <tille> | 2003-05-09 12:01:20 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-09 12:01:20 (UTC) |
commit | d371c94c81f9f0e961aa7e47a27c323215709e8a (patch) (side-by-side diff) | |
tree | 3ad54515f41a9bbb78327cb8ce6e93bab99ff1bf | |
parent | 7183dce01fa07a905d259cb79a8792ca993a75f6 (diff) | |
download | opie-d371c94c81f9f0e961aa7e47a27c323215709e8a.zip opie-d371c94c81f9f0e961aa7e47a27c323215709e8a.tar.gz opie-d371c94c81f9f0e961aa7e47a27c323215709e8a.tar.bz2 |
counting results now
-rw-r--r-- | core/pim/osearch/adresssearch.cpp | 2 | ||||
-rw-r--r-- | core/pim/osearch/datebooksearch.cpp | 1 | ||||
-rw-r--r-- | core/pim/osearch/searchgroup.h | 3 | ||||
-rw-r--r-- | core/pim/osearch/todosearch.cpp | 1 |
4 files changed, 5 insertions, 2 deletions
diff --git a/core/pim/osearch/adresssearch.cpp b/core/pim/osearch/adresssearch.cpp index c5b1ae7..0ee8eba 100644 --- a/core/pim/osearch/adresssearch.cpp +++ b/core/pim/osearch/adresssearch.cpp @@ -1,43 +1,45 @@ // // // C++ Implementation: $MODULE$ // // Description: // // // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 // // Copyright: See COPYING file that comes with this distribution // // #include "adresssearch.h" #include <opie/ocontactaccess.h> +#include <qstring.h> #include "contactitem.h" //#include <qdir.h> AdressSearch::AdressSearch(QListView* parent, QString name): SearchGroup(parent, name) { _contacts = 0; } AdressSearch::~AdressSearch() { delete _contacts; } void AdressSearch::expand() { SearchGroup::expand(); if (_search.isEmpty()) return; if (!_contacts) _contacts = new OContactAccess("osearch"); ORecordList<OContact> results = _contacts->matchRegexp(_search); + setText(0, text(0) + " (" + QString::number( results.count() ) + ")" ); for (uint i = 0; i < results.count(); i++) { new ContactItem( this, new OContact( results[i] )); } } diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp index 8f9d472..0590252 100644 --- a/core/pim/osearch/datebooksearch.cpp +++ b/core/pim/osearch/datebooksearch.cpp @@ -1,62 +1,63 @@ // // // C++ Implementation: $MODULE$ // // Description: // // // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 // // Copyright: See COPYING file that comes with this distribution // // #include "datebooksearch.h" #include "eventitem.h" #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(); } #ifdef LIPBOPIE_SEARCH ORecordList<OEvent> results = _dates->matchRegexp(_search); + setText(0, text(0) + " (" + QString::number( results.count() ) + ")" ); 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/searchgroup.h b/core/pim/osearch/searchgroup.h index 6b6bbf5..4195e6f 100644 --- a/core/pim/osearch/searchgroup.h +++ b/core/pim/osearch/searchgroup.h @@ -1,44 +1,43 @@ // // // 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 +#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 9a22ee1..fba8aa0 100644 --- a/core/pim/osearch/todosearch.cpp +++ b/core/pim/osearch/todosearch.cpp @@ -1,65 +1,66 @@ // // // C++ Implementation: $MODULE$ // // Description: // // // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 // // Copyright: See COPYING file that comes with this distribution // // #include "todosearch.h" #include <opie/otodoaccess.h> #include <opie/otodo.h> #include <qdir.h> #include "todoitem.h" 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); + setText(0, text(0) + " (" + QString::number( results.count() ) + ")"); 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 } |