summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/ocontactaccessbackend_xml.h
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_xml.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_xml.h35
1 files changed, 19 insertions, 16 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h
index 97ef40f..50ea329 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.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 !
* I will debug that stuff in the next time ..
* Please read README_COMPILE for compiling !
*
*
*/
@@ -190,43 +193,43 @@ class OContactAccessBackend_XML : public OContactAccessBackend {
QArray<int> m_currentQuery( m_contactList.count() );
QValueListConstIterator<OContact> it;
uint arraycounter = 0;
for( it = m_contactList.begin(); it != m_contactList.end(); ++it ){
/* Search all fields and compare them with query object. Store them into list
* if all fields matches.
*/
bool allcorrect = true;
for ( int i = 0; i < Qtopia::rid; i++ ) {
/* Just compare fields which are not empty in the query object */
if ( !query.field(i).isEmpty() ){
- switch ( settings & ~OContactAccess::query_IgnoreCase ){
- case OContactAccess::query_RegExp:{
+ switch ( settings & ~OContactAccess::IgnoreCase ){
+ case OContactAccess::RegExp:{
QRegExp expr ( query.field(i),
- !(settings & OContactAccess::query_IgnoreCase),
+ !(settings & OContactAccess::IgnoreCase),
false );
if ( expr.find ( (*it).field(i), 0 ) == -1 )
allcorrect = false;
}
break;
- case OContactAccess::query_WildCards:{
+ case OContactAccess::WildCards:{
QRegExp expr ( query.field(i),
- !(settings & OContactAccess::query_IgnoreCase),
+ !(settings & OContactAccess::IgnoreCase),
true );
if ( expr.find ( (*it).field(i), 0 ) == -1 )
allcorrect = false;
}
break;
- case OContactAccess::query_ExactMatch:{
- if (settings & OContactAccess::query_IgnoreCase){
+ case OContactAccess::ExactMatch:{
+ if (settings & OContactAccess::IgnoreCase){
if ( query.field(i).upper() !=
(*it).field(i).upper() )
allcorrect = false;
}else{
if ( query.field(i) != (*it).field(i) )
allcorrect = false;
}
}
break;
}
}
}
@@ -234,42 +237,42 @@ class OContactAccessBackend_XML : public OContactAccessBackend {
m_currentQuery[arraycounter++] = (*it).uid();
}
}
// Shrink to fit..
m_currentQuery.resize(arraycounter);
return m_currentQuery;
}
const uint querySettings()
{
- return ( OContactAccess::query_WildCards
- & OContactAccess::query_IgnoreCase
- & OContactAccess::query_RegExp
- & OContactAccess::query_ExactMatch );
+ return ( OContactAccess::WildCards
+ & OContactAccess::IgnoreCase
+ & OContactAccess::RegExp
+ & OContactAccess::ExactMatch );
}
bool hasQuerySettings (uint querySettings) const
{
- /* OContactAccess::query_IgnoreCase may be added with one
+ /* OContactAccess::IgnoreCase may be added with one
* of the other settings, but never used alone.
* The other settings are just valid alone...
*/
- switch ( querySettings & ~OContactAccess::query_IgnoreCase ){
- case OContactAccess::query_RegExp:
+ switch ( querySettings & ~OContactAccess::IgnoreCase ){
+ case OContactAccess::RegExp:
return ( true );
- case OContactAccess::query_WildCards:
+ case OContactAccess::WildCards:
return ( true );
- case OContactAccess::query_ExactMatch:
+ case OContactAccess::ExactMatch:
return ( true );
default:
return ( false );
}
}
bool add ( const OContact &newcontact )
{
//qWarning("odefaultbackend: ACTION::ADD");
updateJournal (newcontact, OContact::ACTION_ADD);
addContact_p( newcontact );
return true;