author | eilers <eilers> | 2002-11-01 15:10:42 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-11-01 15:10:42 (UTC) |
commit | 28b70b2b7f8fa03ba0991fb73dccf7b46e5c3d1f (patch) (unidiff) | |
tree | d5ead4aa63aed345ce406c7857ba1ec7813272db /libopie2/opiepim/backend | |
parent | a098735b8749ead08c658792cc31f95e73045107 (diff) | |
download | opie-28b70b2b7f8fa03ba0991fb73dccf7b46e5c3d1f.zip opie-28b70b2b7f8fa03ba0991fb73dccf7b46e5c3d1f.tar.gz opie-28b70b2b7f8fa03ba0991fb73dccf7b46e5c3d1f.tar.bz2 |
Added regExp-search in database for all fields in a contact.
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend.h | 7 | ||||
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.h | 20 |
2 files changed, 27 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend.h b/libopie2/opiepim/backend/ocontactaccessbackend.h index a651477..c898f61 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend.h | |||
@@ -21,2 +21,5 @@ | |||
21 | * $Log$ | 21 | * $Log$ |
22 | * Revision 1.3 2002/11/01 15:10:42 eilers | ||
23 | * Added regExp-search in database for all fields in a contact. | ||
24 | * | ||
22 | * Revision 1.2 2002/10/07 17:34:24 eilers | 25 | * Revision 1.2 2002/10/07 17:34:24 eilers |
@@ -40,2 +43,4 @@ | |||
40 | 43 | ||
44 | #include "qregexp.h" | ||
45 | |||
41 | class OContactAccessBackend: public OPimAccessBackend<OContact> { | 46 | class OContactAccessBackend: public OPimAccessBackend<OContact> { |
@@ -60,2 +65,4 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> { | |||
60 | 65 | ||
66 | virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0; | ||
67 | |||
61 | /** Return all possible settings. | 68 | /** Return all possible settings. |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h index 12a75ba..f7e8207 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h | |||
@@ -19,2 +19,5 @@ | |||
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.5 2002/11/01 15:10:42 eilers | ||
21 | * Added regExp-search in database for all fields in a contact. | ||
22 | * | ||
20 | * Revision 1.4 2002/10/16 10:52:40 eilers | 23 | * Revision 1.4 2002/10/16 10:52:40 eilers |
@@ -256,2 +259,19 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
256 | } | 259 | } |
260 | |||
261 | QArray<int> matchRegexp( const QRegExp &r ) const{ | ||
262 | QArray<int> m_currentQuery( m_contactList.count() ); | ||
263 | QValueListConstIterator<OContact> it; | ||
264 | uint arraycounter = 0; | ||
265 | |||
266 | for( it = m_contactList.begin(); it != m_contactList.end(); ++it ){ | ||
267 | if ( (*it).match( r ) ){ | ||
268 | m_currentQuery[arraycounter++] = (*it).uid(); | ||
269 | } | ||
270 | |||
271 | } | ||
272 | // Shrink to fit.. | ||
273 | m_currentQuery.resize(arraycounter); | ||
274 | |||
275 | return m_currentQuery; | ||
276 | } | ||
257 | 277 | ||