Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp index faa72b4..09ae37b 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | |||
@@ -1,43 +1,46 @@ | |||
1 | /* | 1 | /* |
2 | * VCard Backend for the OPIE-Contact Database. | 2 | * VCard Backend for the OPIE-Contact Database. |
3 | * | 3 | * |
4 | * Copyright (C) 2000 Trolltech AS. All rights reserved. | 4 | * Copyright (C) 2000 Trolltech AS. All rights reserved. |
5 | * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) | 5 | * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) |
6 | * | 6 | * |
7 | * ===================================================================== | 7 | * ===================================================================== |
8 | *This program is free software; you can redistribute it and/or | 8 | *This program is free software; you can redistribute it and/or |
9 | *modify it under the terms of the GNU Library General Public | 9 | *modify it under the terms of the GNU Library General Public |
10 | * License as published by the Free Software Foundation; either | 10 | * License as published by the Free Software Foundation; either |
11 | * version 2 of the License, or (at your option) any later version. | 11 | * version 2 of the License, or (at your option) any later version. |
12 | * ===================================================================== | 12 | * ===================================================================== |
13 | * ToDo: | 13 | * ToDo: |
14 | * | 14 | * |
15 | * ===================================================================== | 15 | * ===================================================================== |
16 | * Version: $Id$ | 16 | * Version: $Id$ |
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.4 2002/11/13 14:14:51 eilers | ||
21 | * Added sorted for Contacts.. | ||
22 | * | ||
20 | * Revision 1.3 2002/11/11 16:41:09 kergoth | 23 | * Revision 1.3 2002/11/11 16:41:09 kergoth |
21 | * no default arguments in implementation | 24 | * no default arguments in implementation |
22 | * | 25 | * |
23 | * Revision 1.2 2002/11/10 15:41:53 eilers | 26 | * Revision 1.2 2002/11/10 15:41:53 eilers |
24 | * Bugfixes.. | 27 | * Bugfixes.. |
25 | * | 28 | * |
26 | * Revision 1.1 2002/11/09 14:34:52 eilers | 29 | * Revision 1.1 2002/11/09 14:34:52 eilers |
27 | * Added VCard Backend. | 30 | * Added VCard Backend. |
28 | * | 31 | * |
29 | */ | 32 | */ |
30 | #include "ocontactaccessbackend_vcard.h" | 33 | #include "ocontactaccessbackend_vcard.h" |
31 | #include "../../library/backend/vobject_p.h" | 34 | #include "../../library/backend/vobject_p.h" |
32 | #include "../../library/backend/qfiledirect_p.h" | 35 | #include "../../library/backend/qfiledirect_p.h" |
33 | 36 | ||
34 | #include <qpe/timeconversion.h> | 37 | #include <qpe/timeconversion.h> |
35 | 38 | ||
36 | #include <qfile.h> | 39 | #include <qfile.h> |
37 | 40 | ||
38 | OContactAccessBackend_VCard::OContactAccessBackend_VCard ( QString , QString filename ): | 41 | OContactAccessBackend_VCard::OContactAccessBackend_VCard ( QString , QString filename ): |
39 | m_dirty( false ), | 42 | m_dirty( false ), |
40 | m_file( filename ) | 43 | m_file( filename ) |
41 | { | 44 | { |
42 | load(); | 45 | load(); |
43 | } | 46 | } |
@@ -157,48 +160,55 @@ QArray<int> OContactAccessBackend_VCard::queryByExample ( const OContact&, int ) | |||
157 | } | 160 | } |
158 | 161 | ||
159 | // Not implemented | 162 | // Not implemented |
160 | QArray<int> OContactAccessBackend_VCard::matchRegexp( const QRegExp& ) const | 163 | QArray<int> OContactAccessBackend_VCard::matchRegexp( const QRegExp& ) const |
161 | { | 164 | { |
162 | QArray<int> ar(0); | 165 | QArray<int> ar(0); |
163 | return ar; | 166 | return ar; |
164 | } | 167 | } |
165 | 168 | ||
166 | const uint OContactAccessBackend_VCard::querySettings() | 169 | const uint OContactAccessBackend_VCard::querySettings() |
167 | { | 170 | { |
168 | return 0; // No search possible | 171 | return 0; // No search possible |
169 | } | 172 | } |
170 | 173 | ||
171 | bool OContactAccessBackend_VCard::hasQuerySettings (uint ) const | 174 | bool OContactAccessBackend_VCard::hasQuerySettings (uint ) const |
172 | { | 175 | { |
173 | return false; // No search possible, therefore all settings invalid ;) | 176 | return false; // No search possible, therefore all settings invalid ;) |
174 | } | 177 | } |
175 | 178 | ||
176 | bool OContactAccessBackend_VCard::wasChangedExternally() | 179 | bool OContactAccessBackend_VCard::wasChangedExternally() |
177 | { | 180 | { |
178 | return false; // Don't expect concurrent access | 181 | return false; // Don't expect concurrent access |
179 | } | 182 | } |
180 | 183 | ||
184 | // Not implemented | ||
185 | QArray<int> OContactAccessBackend_VCard::sorted( bool , int, int, int ) | ||
186 | { | ||
187 | QArray<int> ar(0); | ||
188 | return ar; | ||
189 | } | ||
190 | |||
181 | // *** Private stuff *** | 191 | // *** Private stuff *** |
182 | 192 | ||
183 | 193 | ||
184 | OContact OContactAccessBackend_VCard::parseVObject( VObject *obj ) | 194 | OContact OContactAccessBackend_VCard::parseVObject( VObject *obj ) |
185 | { | 195 | { |
186 | OContact c; | 196 | OContact c; |
187 | 197 | ||
188 | VObjectIterator it; | 198 | VObjectIterator it; |
189 | initPropIterator( &it, obj ); | 199 | initPropIterator( &it, obj ); |
190 | while( moreIteration( &it ) ) { | 200 | while( moreIteration( &it ) ) { |
191 | VObject *o = nextVObject( &it ); | 201 | VObject *o = nextVObject( &it ); |
192 | QCString name = vObjectName( o ); | 202 | QCString name = vObjectName( o ); |
193 | QCString value = vObjectStringZValue( o ); | 203 | QCString value = vObjectStringZValue( o ); |
194 | if ( name == VCNameProp ) { | 204 | if ( name == VCNameProp ) { |
195 | VObjectIterator nit; | 205 | VObjectIterator nit; |
196 | initPropIterator( &nit, o ); | 206 | initPropIterator( &nit, o ); |
197 | while( moreIteration( &nit ) ) { | 207 | while( moreIteration( &nit ) ) { |
198 | VObject *o = nextVObject( &nit ); | 208 | VObject *o = nextVObject( &nit ); |
199 | QCString name = vObjectTypeInfo( o ); | 209 | QCString name = vObjectTypeInfo( o ); |
200 | QString value = vObjectStringZValue( o ); | 210 | QString value = vObjectStringZValue( o ); |
201 | if ( name == VCNamePrefixesProp ) | 211 | if ( name == VCNamePrefixesProp ) |
202 | c.setTitle( value ); | 212 | c.setTitle( value ); |
203 | else if ( name == VCNameSuffixesProp ) | 213 | else if ( name == VCNameSuffixesProp ) |
204 | c.setSuffix( value ); | 214 | c.setSuffix( value ); |