summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/ocontactaccessbackend_xml.h
authoreilers <eilers>2002-11-01 15:10:42 (UTC)
committer eilers <eilers>2002-11-01 15:10:42 (UTC)
commit28b70b2b7f8fa03ba0991fb73dccf7b46e5c3d1f (patch) (side-by-side diff)
treed5ead4aa63aed345ce406c7857ba1ec7813272db /libopie2/opiepim/backend/ocontactaccessbackend_xml.h
parenta098735b8749ead08c658792cc31f95e73045107 (diff)
downloadopie-28b70b2b7f8fa03ba0991fb73dccf7b46e5c3d1f.zip
opie-28b70b2b7f8fa03ba0991fb73dccf7b46e5c3d1f.tar.gz
opie-28b70b2b7f8fa03ba0991fb73dccf7b46e5c3d1f.tar.bz2
Added regExp-search in database for all fields in a contact.
Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_xml.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_xml.h20
1 files changed, 20 insertions, 0 deletions
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
@@ -8,24 +8,27 @@
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* =====================================================================
* ToDo: XML-Backend: Automatic reload if something was changed...
*
*
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.5 2002/11/01 15:10:42 eilers
+ * Added regExp-search in database for all fields in a contact.
+ *
* Revision 1.4 2002/10/16 10:52:40 eilers
* Added some docu to the interface and now using the cache infrastucture by zecke.. :)
*
* Revision 1.3 2002/10/14 16:21:54 eilers
* Some minor interface updates
*
* Revision 1.2 2002/10/07 17:34:24 eilers
* added OBackendFactory for advanced backend access
*
* Revision 1.1 2002/09/27 17:11:44 eilers
* Added API for accessing the Contact-Database ! It is compiling, but
* please do not expect that anything is working !
@@ -245,24 +248,41 @@ class OContactAccessBackend_XML : public OContactAccessBackend {
}
}
if ( allcorrect ){
m_currentQuery[arraycounter++] = (*it).uid();
}
}
// Shrink to fit..
m_currentQuery.resize(arraycounter);
return m_currentQuery;
}
+
+ QArray<int> matchRegexp( const QRegExp &r ) const{
+ QArray<int> m_currentQuery( m_contactList.count() );
+ QValueListConstIterator<OContact> it;
+ uint arraycounter = 0;
+
+ for( it = m_contactList.begin(); it != m_contactList.end(); ++it ){
+ if ( (*it).match( r ) ){
+ m_currentQuery[arraycounter++] = (*it).uid();
+ }
+
+ }
+ // Shrink to fit..
+ m_currentQuery.resize(arraycounter);
+
+ return m_currentQuery;
+ }
const uint querySettings()
{
return ( OContactAccess::WildCards
& OContactAccess::IgnoreCase
& OContactAccess::RegExp
& OContactAccess::ExactMatch );
}
bool hasQuerySettings (uint querySettings) const
{
/* OContactAccess::IgnoreCase may be added with one