-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.h | 35 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.h | 2 |
3 files changed, 21 insertions, 18 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 | |||
@@ -17,6 +17,9 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.3 2002/10/14 16:21:54 eilers | ||
21 | * Some minor interface updates | ||
22 | * | ||
20 | * Revision 1.2 2002/10/07 17:34:24 eilers | 23 | * Revision 1.2 2002/10/07 17:34:24 eilers |
21 | * added OBackendFactory for advanced backend access | 24 | * added OBackendFactory for advanced backend access |
22 | * | 25 | * |
@@ -199,25 +202,25 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
199 | for ( int i = 0; i < Qtopia::rid; i++ ) { | 202 | for ( int i = 0; i < Qtopia::rid; i++ ) { |
200 | /* Just compare fields which are not empty in the query object */ | 203 | /* Just compare fields which are not empty in the query object */ |
201 | if ( !query.field(i).isEmpty() ){ | 204 | if ( !query.field(i).isEmpty() ){ |
202 | switch ( settings & ~OContactAccess::query_IgnoreCase ){ | 205 | switch ( settings & ~OContactAccess::IgnoreCase ){ |
203 | case OContactAccess::query_RegExp:{ | 206 | case OContactAccess::RegExp:{ |
204 | QRegExp expr ( query.field(i), | 207 | QRegExp expr ( query.field(i), |
205 | !(settings & OContactAccess::query_IgnoreCase), | 208 | !(settings & OContactAccess::IgnoreCase), |
206 | false ); | 209 | false ); |
207 | if ( expr.find ( (*it).field(i), 0 ) == -1 ) | 210 | if ( expr.find ( (*it).field(i), 0 ) == -1 ) |
208 | allcorrect = false; | 211 | allcorrect = false; |
209 | } | 212 | } |
210 | break; | 213 | break; |
211 | case OContactAccess::query_WildCards:{ | 214 | case OContactAccess::WildCards:{ |
212 | QRegExp expr ( query.field(i), | 215 | QRegExp expr ( query.field(i), |
213 | !(settings & OContactAccess::query_IgnoreCase), | 216 | !(settings & OContactAccess::IgnoreCase), |
214 | true ); | 217 | true ); |
215 | if ( expr.find ( (*it).field(i), 0 ) == -1 ) | 218 | if ( expr.find ( (*it).field(i), 0 ) == -1 ) |
216 | allcorrect = false; | 219 | allcorrect = false; |
217 | } | 220 | } |
218 | break; | 221 | break; |
219 | case OContactAccess::query_ExactMatch:{ | 222 | case OContactAccess::ExactMatch:{ |
220 | if (settings & OContactAccess::query_IgnoreCase){ | 223 | if (settings & OContactAccess::IgnoreCase){ |
221 | if ( query.field(i).upper() != | 224 | if ( query.field(i).upper() != |
222 | (*it).field(i).upper() ) | 225 | (*it).field(i).upper() ) |
223 | allcorrect = false; | 226 | allcorrect = false; |
@@ -243,24 +246,24 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
243 | 246 | ||
244 | const uint querySettings() | 247 | const uint querySettings() |
245 | { | 248 | { |
246 | return ( OContactAccess::query_WildCards | 249 | return ( OContactAccess::WildCards |
247 | & OContactAccess::query_IgnoreCase | 250 | & OContactAccess::IgnoreCase |
248 | & OContactAccess::query_RegExp | 251 | & OContactAccess::RegExp |
249 | & OContactAccess::query_ExactMatch ); | 252 | & OContactAccess::ExactMatch ); |
250 | } | 253 | } |
251 | 254 | ||
252 | bool hasQuerySettings (uint querySettings) const | 255 | bool hasQuerySettings (uint querySettings) const |
253 | { | 256 | { |
254 | /* OContactAccess::query_IgnoreCase may be added with one | 257 | /* OContactAccess::IgnoreCase may be added with one |
255 | * of the other settings, but never used alone. | 258 | * of the other settings, but never used alone. |
256 | * The other settings are just valid alone... | 259 | * The other settings are just valid alone... |
257 | */ | 260 | */ |
258 | switch ( querySettings & ~OContactAccess::query_IgnoreCase ){ | 261 | switch ( querySettings & ~OContactAccess::IgnoreCase ){ |
259 | case OContactAccess::query_RegExp: | 262 | case OContactAccess::RegExp: |
260 | return ( true ); | 263 | return ( true ); |
261 | case OContactAccess::query_WildCards: | 264 | case OContactAccess::WildCards: |
262 | return ( true ); | 265 | return ( true ); |
263 | case OContactAccess::query_ExactMatch: | 266 | case OContactAccess::ExactMatch: |
264 | return ( true ); | 267 | return ( true ); |
265 | default: | 268 | default: |
266 | return ( false ); | 269 | return ( false ); |
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp index f3b0783..3b4cab2 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.cpp +++ b/libopie2/opiepim/backend/otodoaccessxml.cpp | |||
@@ -187,7 +187,7 @@ QArray<int> OTodoAccessXML::allRecords()const { | |||
187 | } | 187 | } |
188 | return ids; | 188 | return ids; |
189 | } | 189 | } |
190 | QArray<int> OTodoAccessXML::queryByExample( const OTodo&, int sort ) { | 190 | QArray<int> OTodoAccessXML::queryByExample( const OTodo&, int ) { |
191 | QArray<int> ids(0); | 191 | QArray<int> ids(0); |
192 | return ids; | 192 | return ids; |
193 | } | 193 | } |
diff --git a/libopie2/opiepim/backend/otodoaccessxml.h b/libopie2/opiepim/backend/otodoaccessxml.h index 1e7e371..dc41c32 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.h +++ b/libopie2/opiepim/backend/otodoaccessxml.h | |||
@@ -24,7 +24,7 @@ public: | |||
24 | bool save(); | 24 | bool save(); |
25 | 25 | ||
26 | QArray<int> allRecords()const; | 26 | QArray<int> allRecords()const; |
27 | QArray<int> queryByExample( const OTodo&, int sort ); | 27 | QArray<int> queryByExample( const OTodo&, int querysettings ); |
28 | OTodo find( int uid )const; | 28 | OTodo find( int uid )const; |
29 | void clear(); | 29 | void clear(); |
30 | bool add( const OTodo& ); | 30 | bool add( const OTodo& ); |