author | zecke <zecke> | 2003-02-16 22:25:46 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-02-16 22:25:46 (UTC) |
commit | 4d0e8ffd8518fe24ed94cfcf92eeff666b014094 (patch) (unidiff) | |
tree | 86a0bec752418c409cbc9ad95d6479997dfaf909 | |
parent | 8ecc375c803dc57b160bd0335891fcaf4f6de1df (diff) | |
download | opie-4d0e8ffd8518fe24ed94cfcf92eeff666b014094.zip opie-4d0e8ffd8518fe24ed94cfcf92eeff666b014094.tar.gz opie-4d0e8ffd8518fe24ed94cfcf92eeff666b014094.tar.bz2 |
0000276 Fix for that bug.. or better temp workaround
A Preferred Number is HOME|VOICE
A CellPhone is HOME|VOICE|CELL the type & HOME|VOICE test
triggers both
and the cell phone number overrides the other entries..
as a temp I check that it's not equal to HOME|VOICE|CELL before setting the
number
The right and final fix would be to reorder the if statement to make it
if else based and the less common thing put to the bottom
OTodoAccessVcal fix the date for beaming
-rw-r--r-- | libopie/pim/ocontactaccessbackend_vcard.cpp | 20 | ||||
-rw-r--r-- | libopie/pim/otodoaccessvcal.cpp | 7 | ||||
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | 20 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessvcal.cpp | 7 |
4 files changed, 46 insertions, 8 deletions
diff --git a/libopie/pim/ocontactaccessbackend_vcard.cpp b/libopie/pim/ocontactaccessbackend_vcard.cpp index 1dc6b48..622d40a 100644 --- a/libopie/pim/ocontactaccessbackend_vcard.cpp +++ b/libopie/pim/ocontactaccessbackend_vcard.cpp | |||
@@ -1,43 +1,58 @@ | |||
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.7 2003/02/16 22:25:46 zecke | ||
21 | * 0000276 Fix for that bug.. or better temp workaround | ||
22 | * A Preferred Number is HOME|VOICE | ||
23 | * A CellPhone is HOME|VOICE|CELL the type & HOME|VOICE test | ||
24 | * triggers both | ||
25 | * and the cell phone number overrides the other entries.. | ||
26 | * | ||
27 | * as a temp I check that it's not equal to HOME|VOICE|CELL before setting the | ||
28 | * number | ||
29 | * | ||
30 | * The right and final fix would be to reorder the if statement to make it | ||
31 | * if else based and the less common thing put to the bottom | ||
32 | * | ||
33 | * OTodoAccessVcal fix the date for beaming | ||
34 | * | ||
20 | * Revision 1.6 2003/01/13 15:49:31 eilers | 35 | * Revision 1.6 2003/01/13 15:49:31 eilers |
21 | * Fixing crash when businesscard.vcf is missing.. | 36 | * Fixing crash when businesscard.vcf is missing.. |
22 | * | 37 | * |
23 | * Revision 1.5 2002/12/07 13:26:22 eilers | 38 | * Revision 1.5 2002/12/07 13:26:22 eilers |
24 | * Fixing bug in storing anniversary.. | 39 | * Fixing bug in storing anniversary.. |
25 | * | 40 | * |
26 | * Revision 1.4 2002/11/13 14:14:51 eilers | 41 | * Revision 1.4 2002/11/13 14:14:51 eilers |
27 | * Added sorted for Contacts.. | 42 | * Added sorted for Contacts.. |
28 | * | 43 | * |
29 | * Revision 1.3 2002/11/11 16:41:09 kergoth | 44 | * Revision 1.3 2002/11/11 16:41:09 kergoth |
30 | * no default arguments in implementation | 45 | * no default arguments in implementation |
31 | * | 46 | * |
32 | * Revision 1.2 2002/11/10 15:41:53 eilers | 47 | * Revision 1.2 2002/11/10 15:41:53 eilers |
33 | * Bugfixes.. | 48 | * Bugfixes.. |
34 | * | 49 | * |
35 | * Revision 1.1 2002/11/09 14:34:52 eilers | 50 | * Revision 1.1 2002/11/09 14:34:52 eilers |
36 | * Added VCard Backend. | 51 | * Added VCard Backend. |
37 | * | 52 | * |
38 | */ | 53 | */ |
39 | #include "ocontactaccessbackend_vcard.h" | 54 | #include "ocontactaccessbackend_vcard.h" |
40 | #include "../../library/backend/vobject_p.h" | 55 | #include "../../library/backend/vobject_p.h" |
41 | #include "../../library/backend/qfiledirect_p.h" | 56 | #include "../../library/backend/qfiledirect_p.h" |
42 | 57 | ||
43 | #include <qpe/timeconversion.h> | 58 | #include <qpe/timeconversion.h> |
@@ -294,55 +309,56 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj ) | |||
294 | QCString name = vObjectTypeInfo( o ); | 309 | QCString name = vObjectTypeInfo( o ); |
295 | if ( name == VCHomeProp ) | 310 | if ( name == VCHomeProp ) |
296 | type |= HOME; | 311 | type |= HOME; |
297 | else if ( name == VCWorkProp ) | 312 | else if ( name == VCWorkProp ) |
298 | type |= WORK; | 313 | type |= WORK; |
299 | else if ( name == VCVoiceProp ) | 314 | else if ( name == VCVoiceProp ) |
300 | type |= VOICE; | 315 | type |= VOICE; |
301 | else if ( name == VCCellularProp ) | 316 | else if ( name == VCCellularProp ) |
302 | type |= CELL; | 317 | type |= CELL; |
303 | else if ( name == VCFaxProp ) | 318 | else if ( name == VCFaxProp ) |
304 | type |= FAX; | 319 | type |= FAX; |
305 | else if ( name == VCPagerProp ) | 320 | else if ( name == VCPagerProp ) |
306 | type |= PAGER; | 321 | type |= PAGER; |
307 | else if ( name == VCPreferredProp ) | 322 | else if ( name == VCPreferredProp ) |
308 | ; | 323 | ; |
309 | else | 324 | else |
310 | type |= UNKNOWN; | 325 | type |= UNKNOWN; |
311 | } | 326 | } |
312 | if ( (type & UNKNOWN) != UNKNOWN ) { | 327 | if ( (type & UNKNOWN) != UNKNOWN ) { |
313 | if ( ( type & (HOME|WORK) ) == 0 ) // default | 328 | if ( ( type & (HOME|WORK) ) == 0 ) // default |
314 | type |= HOME; | 329 | type |= HOME; |
315 | if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default | 330 | if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default |
316 | type |= VOICE; | 331 | type |= VOICE; |
317 | 332 | ||
318 | if ( (type & (VOICE|HOME) ) == (VOICE|HOME) ) | 333 | qWarning("value %s %d", value.data(), type ); |
334 | if ( (type & (VOICE|HOME) ) == (VOICE|HOME) && (type & (CELL|HOME) ) != (CELL|HOME) ) | ||
319 | c.setHomePhone( value ); | 335 | c.setHomePhone( value ); |
320 | if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) | 336 | if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) |
321 | c.setHomeFax( value ); | 337 | c.setHomeFax( value ); |
322 | if ( ( type & (CELL|HOME) ) == (CELL|HOME) ) | 338 | if ( ( type & (CELL|HOME) ) == (CELL|HOME) ) |
323 | c.setHomeMobile( value ); | 339 | c.setHomeMobile( value ); |
324 | if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) ) | 340 | if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) && (type & (CELL|WORK) ) != (CELL|WORK) ) |
325 | c.setBusinessPhone( value ); | 341 | c.setBusinessPhone( value ); |
326 | if ( ( type & (FAX|WORK) ) == (FAX|WORK) ) | 342 | if ( ( type & (FAX|WORK) ) == (FAX|WORK) ) |
327 | c.setBusinessFax( value ); | 343 | c.setBusinessFax( value ); |
328 | if ( ( type & (CELL|WORK) ) == (CELL|WORK) ) | 344 | if ( ( type & (CELL|WORK) ) == (CELL|WORK) ) |
329 | c.setBusinessMobile( value ); | 345 | c.setBusinessMobile( value ); |
330 | if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) ) | 346 | if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) ) |
331 | c.setBusinessPager( value ); | 347 | c.setBusinessPager( value ); |
332 | } | 348 | } |
333 | } | 349 | } |
334 | else if ( name == VCEmailAddressProp ) { | 350 | else if ( name == VCEmailAddressProp ) { |
335 | QString email = vObjectStringZValue( o ); | 351 | QString email = vObjectStringZValue( o ); |
336 | bool valid = TRUE; | 352 | bool valid = TRUE; |
337 | VObjectIterator nit; | 353 | VObjectIterator nit; |
338 | initPropIterator( &nit, o ); | 354 | initPropIterator( &nit, o ); |
339 | while( moreIteration( &nit ) ) { | 355 | while( moreIteration( &nit ) ) { |
340 | VObject *o = nextVObject( &nit ); | 356 | VObject *o = nextVObject( &nit ); |
341 | QCString name = vObjectTypeInfo( o ); | 357 | QCString name = vObjectTypeInfo( o ); |
342 | if ( name != VCInternetProp && name != VCHomeProp && | 358 | if ( name != VCInternetProp && name != VCHomeProp && |
343 | name != VCWorkProp && | 359 | name != VCWorkProp && |
344 | name != VCPreferredProp ) | 360 | name != VCPreferredProp ) |
345 | // ### preffered should map to default email | 361 | // ### preffered should map to default email |
346 | valid = FALSE; | 362 | valid = FALSE; |
347 | } | 363 | } |
348 | if ( valid ) { | 364 | if ( valid ) { |
diff --git a/libopie/pim/otodoaccessvcal.cpp b/libopie/pim/otodoaccessvcal.cpp index e96cc3c..309f9e1 100644 --- a/libopie/pim/otodoaccessvcal.cpp +++ b/libopie/pim/otodoaccessvcal.cpp | |||
@@ -37,51 +37,54 @@ namespace { | |||
37 | name = vObjectStringZValue( ob ); | 37 | name = vObjectStringZValue( ob ); |
38 | bool ok; | 38 | bool ok; |
39 | event.setPriority(name.toInt(&ok) ); | 39 | event.setPriority(name.toInt(&ok) ); |
40 | } | 40 | } |
41 | //due date | 41 | //due date |
42 | if((ob = isAPropertyOf(obj, VCDueProp)) ){ | 42 | if((ob = isAPropertyOf(obj, VCDueProp)) ){ |
43 | event.setHasDueDate( true ); | 43 | event.setHasDueDate( true ); |
44 | name = vObjectStringZValue( ob ); | 44 | name = vObjectStringZValue( ob ); |
45 | event.setDueDate( TimeConversion::fromISO8601( name).date() ); | 45 | event.setDueDate( TimeConversion::fromISO8601( name).date() ); |
46 | } | 46 | } |
47 | // categories | 47 | // categories |
48 | if((ob = isAPropertyOf( obj, VCCategoriesProp )) != 0 ){ | 48 | if((ob = isAPropertyOf( obj, VCCategoriesProp )) != 0 ){ |
49 | name = vObjectStringZValue( ob ); | 49 | name = vObjectStringZValue( ob ); |
50 | qWarning("Categories:%s", name.data() ); | 50 | qWarning("Categories:%s", name.data() ); |
51 | } | 51 | } |
52 | 52 | ||
53 | event.setUid( 1 ); | 53 | event.setUid( 1 ); |
54 | return event; | 54 | return event; |
55 | }; | 55 | }; |
56 | static VObject *vobjByEvent( const OTodo &event ) { | 56 | static VObject *vobjByEvent( const OTodo &event ) { |
57 | VObject *task = newVObject( VCTodoProp ); | 57 | VObject *task = newVObject( VCTodoProp ); |
58 | if( task == 0 ) | 58 | if( task == 0 ) |
59 | return 0l; | 59 | return 0l; |
60 | 60 | ||
61 | if( event.hasDueDate() ) | 61 | if( event.hasDueDate() ) { |
62 | QTime time(0, 0, 0); | ||
63 | QDateTime date(event.dueDate(), time ); | ||
62 | addPropValue( task, VCDueProp, | 64 | addPropValue( task, VCDueProp, |
63 | TimeConversion::toISO8601( event.dueDate() ) ); | 65 | TimeConversion::toISO8601( date ) ); |
66 | } | ||
64 | 67 | ||
65 | if( event.isCompleted() ) | 68 | if( event.isCompleted() ) |
66 | addPropValue( task, VCStatusProp, "COMPLETED"); | 69 | addPropValue( task, VCStatusProp, "COMPLETED"); |
67 | 70 | ||
68 | QString string = QString::number(event.priority() ); | 71 | QString string = QString::number(event.priority() ); |
69 | addPropValue( task, VCPriorityProp, string.local8Bit() ); | 72 | addPropValue( task, VCPriorityProp, string.local8Bit() ); |
70 | 73 | ||
71 | addPropValue( task, VCCategoriesProp, | 74 | addPropValue( task, VCCategoriesProp, |
72 | event.idsToString( event.categories() ).local8Bit() ); | 75 | event.idsToString( event.categories() ).local8Bit() ); |
73 | 76 | ||
74 | addPropValue( task, VCDescriptionProp, | 77 | addPropValue( task, VCDescriptionProp, |
75 | event.description().local8Bit() ); | 78 | event.description().local8Bit() ); |
76 | 79 | ||
77 | addPropValue( task, VCSummaryProp, | 80 | addPropValue( task, VCSummaryProp, |
78 | event.summary().local8Bit() ); | 81 | event.summary().local8Bit() ); |
79 | return task; | 82 | return task; |
80 | }; | 83 | }; |
81 | } | 84 | } |
82 | 85 | ||
83 | OTodoAccessVCal::OTodoAccessVCal( const QString& path ) | 86 | OTodoAccessVCal::OTodoAccessVCal( const QString& path ) |
84 | : m_dirty(false), m_file( path ) | 87 | : m_dirty(false), m_file( path ) |
85 | { | 88 | { |
86 | } | 89 | } |
87 | OTodoAccessVCal::~OTodoAccessVCal() { | 90 | OTodoAccessVCal::~OTodoAccessVCal() { |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp index 1dc6b48..622d40a 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | |||
@@ -1,43 +1,58 @@ | |||
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.7 2003/02/16 22:25:46 zecke | ||
21 | * 0000276 Fix for that bug.. or better temp workaround | ||
22 | * A Preferred Number is HOME|VOICE | ||
23 | * A CellPhone is HOME|VOICE|CELL the type & HOME|VOICE test | ||
24 | * triggers both | ||
25 | * and the cell phone number overrides the other entries.. | ||
26 | * | ||
27 | * as a temp I check that it's not equal to HOME|VOICE|CELL before setting the | ||
28 | * number | ||
29 | * | ||
30 | * The right and final fix would be to reorder the if statement to make it | ||
31 | * if else based and the less common thing put to the bottom | ||
32 | * | ||
33 | * OTodoAccessVcal fix the date for beaming | ||
34 | * | ||
20 | * Revision 1.6 2003/01/13 15:49:31 eilers | 35 | * Revision 1.6 2003/01/13 15:49:31 eilers |
21 | * Fixing crash when businesscard.vcf is missing.. | 36 | * Fixing crash when businesscard.vcf is missing.. |
22 | * | 37 | * |
23 | * Revision 1.5 2002/12/07 13:26:22 eilers | 38 | * Revision 1.5 2002/12/07 13:26:22 eilers |
24 | * Fixing bug in storing anniversary.. | 39 | * Fixing bug in storing anniversary.. |
25 | * | 40 | * |
26 | * Revision 1.4 2002/11/13 14:14:51 eilers | 41 | * Revision 1.4 2002/11/13 14:14:51 eilers |
27 | * Added sorted for Contacts.. | 42 | * Added sorted for Contacts.. |
28 | * | 43 | * |
29 | * Revision 1.3 2002/11/11 16:41:09 kergoth | 44 | * Revision 1.3 2002/11/11 16:41:09 kergoth |
30 | * no default arguments in implementation | 45 | * no default arguments in implementation |
31 | * | 46 | * |
32 | * Revision 1.2 2002/11/10 15:41:53 eilers | 47 | * Revision 1.2 2002/11/10 15:41:53 eilers |
33 | * Bugfixes.. | 48 | * Bugfixes.. |
34 | * | 49 | * |
35 | * Revision 1.1 2002/11/09 14:34:52 eilers | 50 | * Revision 1.1 2002/11/09 14:34:52 eilers |
36 | * Added VCard Backend. | 51 | * Added VCard Backend. |
37 | * | 52 | * |
38 | */ | 53 | */ |
39 | #include "ocontactaccessbackend_vcard.h" | 54 | #include "ocontactaccessbackend_vcard.h" |
40 | #include "../../library/backend/vobject_p.h" | 55 | #include "../../library/backend/vobject_p.h" |
41 | #include "../../library/backend/qfiledirect_p.h" | 56 | #include "../../library/backend/qfiledirect_p.h" |
42 | 57 | ||
43 | #include <qpe/timeconversion.h> | 58 | #include <qpe/timeconversion.h> |
@@ -294,55 +309,56 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj ) | |||
294 | QCString name = vObjectTypeInfo( o ); | 309 | QCString name = vObjectTypeInfo( o ); |
295 | if ( name == VCHomeProp ) | 310 | if ( name == VCHomeProp ) |
296 | type |= HOME; | 311 | type |= HOME; |
297 | else if ( name == VCWorkProp ) | 312 | else if ( name == VCWorkProp ) |
298 | type |= WORK; | 313 | type |= WORK; |
299 | else if ( name == VCVoiceProp ) | 314 | else if ( name == VCVoiceProp ) |
300 | type |= VOICE; | 315 | type |= VOICE; |
301 | else if ( name == VCCellularProp ) | 316 | else if ( name == VCCellularProp ) |
302 | type |= CELL; | 317 | type |= CELL; |
303 | else if ( name == VCFaxProp ) | 318 | else if ( name == VCFaxProp ) |
304 | type |= FAX; | 319 | type |= FAX; |
305 | else if ( name == VCPagerProp ) | 320 | else if ( name == VCPagerProp ) |
306 | type |= PAGER; | 321 | type |= PAGER; |
307 | else if ( name == VCPreferredProp ) | 322 | else if ( name == VCPreferredProp ) |
308 | ; | 323 | ; |
309 | else | 324 | else |
310 | type |= UNKNOWN; | 325 | type |= UNKNOWN; |
311 | } | 326 | } |
312 | if ( (type & UNKNOWN) != UNKNOWN ) { | 327 | if ( (type & UNKNOWN) != UNKNOWN ) { |
313 | if ( ( type & (HOME|WORK) ) == 0 ) // default | 328 | if ( ( type & (HOME|WORK) ) == 0 ) // default |
314 | type |= HOME; | 329 | type |= HOME; |
315 | if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default | 330 | if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default |
316 | type |= VOICE; | 331 | type |= VOICE; |
317 | 332 | ||
318 | if ( (type & (VOICE|HOME) ) == (VOICE|HOME) ) | 333 | qWarning("value %s %d", value.data(), type ); |
334 | if ( (type & (VOICE|HOME) ) == (VOICE|HOME) && (type & (CELL|HOME) ) != (CELL|HOME) ) | ||
319 | c.setHomePhone( value ); | 335 | c.setHomePhone( value ); |
320 | if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) | 336 | if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) |
321 | c.setHomeFax( value ); | 337 | c.setHomeFax( value ); |
322 | if ( ( type & (CELL|HOME) ) == (CELL|HOME) ) | 338 | if ( ( type & (CELL|HOME) ) == (CELL|HOME) ) |
323 | c.setHomeMobile( value ); | 339 | c.setHomeMobile( value ); |
324 | if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) ) | 340 | if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) && (type & (CELL|WORK) ) != (CELL|WORK) ) |
325 | c.setBusinessPhone( value ); | 341 | c.setBusinessPhone( value ); |
326 | if ( ( type & (FAX|WORK) ) == (FAX|WORK) ) | 342 | if ( ( type & (FAX|WORK) ) == (FAX|WORK) ) |
327 | c.setBusinessFax( value ); | 343 | c.setBusinessFax( value ); |
328 | if ( ( type & (CELL|WORK) ) == (CELL|WORK) ) | 344 | if ( ( type & (CELL|WORK) ) == (CELL|WORK) ) |
329 | c.setBusinessMobile( value ); | 345 | c.setBusinessMobile( value ); |
330 | if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) ) | 346 | if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) ) |
331 | c.setBusinessPager( value ); | 347 | c.setBusinessPager( value ); |
332 | } | 348 | } |
333 | } | 349 | } |
334 | else if ( name == VCEmailAddressProp ) { | 350 | else if ( name == VCEmailAddressProp ) { |
335 | QString email = vObjectStringZValue( o ); | 351 | QString email = vObjectStringZValue( o ); |
336 | bool valid = TRUE; | 352 | bool valid = TRUE; |
337 | VObjectIterator nit; | 353 | VObjectIterator nit; |
338 | initPropIterator( &nit, o ); | 354 | initPropIterator( &nit, o ); |
339 | while( moreIteration( &nit ) ) { | 355 | while( moreIteration( &nit ) ) { |
340 | VObject *o = nextVObject( &nit ); | 356 | VObject *o = nextVObject( &nit ); |
341 | QCString name = vObjectTypeInfo( o ); | 357 | QCString name = vObjectTypeInfo( o ); |
342 | if ( name != VCInternetProp && name != VCHomeProp && | 358 | if ( name != VCInternetProp && name != VCHomeProp && |
343 | name != VCWorkProp && | 359 | name != VCWorkProp && |
344 | name != VCPreferredProp ) | 360 | name != VCPreferredProp ) |
345 | // ### preffered should map to default email | 361 | // ### preffered should map to default email |
346 | valid = FALSE; | 362 | valid = FALSE; |
347 | } | 363 | } |
348 | if ( valid ) { | 364 | if ( valid ) { |
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp index e96cc3c..309f9e1 100644 --- a/libopie2/opiepim/backend/otodoaccessvcal.cpp +++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp | |||
@@ -37,51 +37,54 @@ namespace { | |||
37 | name = vObjectStringZValue( ob ); | 37 | name = vObjectStringZValue( ob ); |
38 | bool ok; | 38 | bool ok; |
39 | event.setPriority(name.toInt(&ok) ); | 39 | event.setPriority(name.toInt(&ok) ); |
40 | } | 40 | } |
41 | //due date | 41 | //due date |
42 | if((ob = isAPropertyOf(obj, VCDueProp)) ){ | 42 | if((ob = isAPropertyOf(obj, VCDueProp)) ){ |
43 | event.setHasDueDate( true ); | 43 | event.setHasDueDate( true ); |
44 | name = vObjectStringZValue( ob ); | 44 | name = vObjectStringZValue( ob ); |
45 | event.setDueDate( TimeConversion::fromISO8601( name).date() ); | 45 | event.setDueDate( TimeConversion::fromISO8601( name).date() ); |
46 | } | 46 | } |
47 | // categories | 47 | // categories |
48 | if((ob = isAPropertyOf( obj, VCCategoriesProp )) != 0 ){ | 48 | if((ob = isAPropertyOf( obj, VCCategoriesProp )) != 0 ){ |
49 | name = vObjectStringZValue( ob ); | 49 | name = vObjectStringZValue( ob ); |
50 | qWarning("Categories:%s", name.data() ); | 50 | qWarning("Categories:%s", name.data() ); |
51 | } | 51 | } |
52 | 52 | ||
53 | event.setUid( 1 ); | 53 | event.setUid( 1 ); |
54 | return event; | 54 | return event; |
55 | }; | 55 | }; |
56 | static VObject *vobjByEvent( const OTodo &event ) { | 56 | static VObject *vobjByEvent( const OTodo &event ) { |
57 | VObject *task = newVObject( VCTodoProp ); | 57 | VObject *task = newVObject( VCTodoProp ); |
58 | if( task == 0 ) | 58 | if( task == 0 ) |
59 | return 0l; | 59 | return 0l; |
60 | 60 | ||
61 | if( event.hasDueDate() ) | 61 | if( event.hasDueDate() ) { |
62 | QTime time(0, 0, 0); | ||
63 | QDateTime date(event.dueDate(), time ); | ||
62 | addPropValue( task, VCDueProp, | 64 | addPropValue( task, VCDueProp, |
63 | TimeConversion::toISO8601( event.dueDate() ) ); | 65 | TimeConversion::toISO8601( date ) ); |
66 | } | ||
64 | 67 | ||
65 | if( event.isCompleted() ) | 68 | if( event.isCompleted() ) |
66 | addPropValue( task, VCStatusProp, "COMPLETED"); | 69 | addPropValue( task, VCStatusProp, "COMPLETED"); |
67 | 70 | ||
68 | QString string = QString::number(event.priority() ); | 71 | QString string = QString::number(event.priority() ); |
69 | addPropValue( task, VCPriorityProp, string.local8Bit() ); | 72 | addPropValue( task, VCPriorityProp, string.local8Bit() ); |
70 | 73 | ||
71 | addPropValue( task, VCCategoriesProp, | 74 | addPropValue( task, VCCategoriesProp, |
72 | event.idsToString( event.categories() ).local8Bit() ); | 75 | event.idsToString( event.categories() ).local8Bit() ); |
73 | 76 | ||
74 | addPropValue( task, VCDescriptionProp, | 77 | addPropValue( task, VCDescriptionProp, |
75 | event.description().local8Bit() ); | 78 | event.description().local8Bit() ); |
76 | 79 | ||
77 | addPropValue( task, VCSummaryProp, | 80 | addPropValue( task, VCSummaryProp, |
78 | event.summary().local8Bit() ); | 81 | event.summary().local8Bit() ); |
79 | return task; | 82 | return task; |
80 | }; | 83 | }; |
81 | } | 84 | } |
82 | 85 | ||
83 | OTodoAccessVCal::OTodoAccessVCal( const QString& path ) | 86 | OTodoAccessVCal::OTodoAccessVCal( const QString& path ) |
84 | : m_dirty(false), m_file( path ) | 87 | : m_dirty(false), m_file( path ) |
85 | { | 88 | { |
86 | } | 89 | } |
87 | OTodoAccessVCal::~OTodoAccessVCal() { | 90 | OTodoAccessVCal::~OTodoAccessVCal() { |