-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 @@ -8,24 +8,39 @@ * This program is free software; you can redistribute it and/or * 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: * * ===================================================================== * Version: $Id$ * ===================================================================== * History: * $Log$ + * Revision 1.7 2003/02/16 22:25:46 zecke + * 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 + * * Revision 1.6 2003/01/13 15:49:31 eilers * Fixing crash when businesscard.vcf is missing.. * * Revision 1.5 2002/12/07 13:26:22 eilers * Fixing bug in storing anniversary.. * * Revision 1.4 2002/11/13 14:14:51 eilers * Added sorted for Contacts.. * * Revision 1.3 2002/11/11 16:41:09 kergoth * no default arguments in implementation * @@ -306,31 +321,32 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj ) type |= PAGER; else if ( name == VCPreferredProp ) ; else type |= UNKNOWN; } if ( (type & UNKNOWN) != UNKNOWN ) { if ( ( type & (HOME|WORK) ) == 0 ) // default type |= HOME; if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default type |= VOICE; - if ( (type & (VOICE|HOME) ) == (VOICE|HOME) ) + qWarning("value %s %d", value.data(), type ); + if ( (type & (VOICE|HOME) ) == (VOICE|HOME) && (type & (CELL|HOME) ) != (CELL|HOME) ) c.setHomePhone( value ); if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) c.setHomeFax( value ); if ( ( type & (CELL|HOME) ) == (CELL|HOME) ) c.setHomeMobile( value ); - if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) ) + if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) && (type & (CELL|WORK) ) != (CELL|WORK) ) c.setBusinessPhone( value ); if ( ( type & (FAX|WORK) ) == (FAX|WORK) ) c.setBusinessFax( value ); if ( ( type & (CELL|WORK) ) == (CELL|WORK) ) c.setBusinessMobile( value ); if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) ) c.setBusinessPager( value ); } } else if ( name == VCEmailAddressProp ) { QString email = vObjectStringZValue( o ); bool valid = TRUE; 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 @@ -49,27 +49,30 @@ namespace { name = vObjectStringZValue( ob ); qWarning("Categories:%s", name.data() ); } event.setUid( 1 ); return event; }; static VObject *vobjByEvent( const OTodo &event ) { VObject *task = newVObject( VCTodoProp ); if( task == 0 ) return 0l; - if( event.hasDueDate() ) + if( event.hasDueDate() ) { + QTime time(0, 0, 0); + QDateTime date(event.dueDate(), time ); addPropValue( task, VCDueProp, - TimeConversion::toISO8601( event.dueDate() ) ); + TimeConversion::toISO8601( date ) ); + } if( event.isCompleted() ) addPropValue( task, VCStatusProp, "COMPLETED"); QString string = QString::number(event.priority() ); addPropValue( task, VCPriorityProp, string.local8Bit() ); addPropValue( task, VCCategoriesProp, event.idsToString( event.categories() ).local8Bit() ); addPropValue( task, VCDescriptionProp, event.description().local8Bit() ); 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 @@ -8,24 +8,39 @@ * This program is free software; you can redistribute it and/or * 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: * * ===================================================================== * Version: $Id$ * ===================================================================== * History: * $Log$ + * Revision 1.7 2003/02/16 22:25:46 zecke + * 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 + * * Revision 1.6 2003/01/13 15:49:31 eilers * Fixing crash when businesscard.vcf is missing.. * * Revision 1.5 2002/12/07 13:26:22 eilers * Fixing bug in storing anniversary.. * * Revision 1.4 2002/11/13 14:14:51 eilers * Added sorted for Contacts.. * * Revision 1.3 2002/11/11 16:41:09 kergoth * no default arguments in implementation * @@ -306,31 +321,32 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj ) type |= PAGER; else if ( name == VCPreferredProp ) ; else type |= UNKNOWN; } if ( (type & UNKNOWN) != UNKNOWN ) { if ( ( type & (HOME|WORK) ) == 0 ) // default type |= HOME; if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default type |= VOICE; - if ( (type & (VOICE|HOME) ) == (VOICE|HOME) ) + qWarning("value %s %d", value.data(), type ); + if ( (type & (VOICE|HOME) ) == (VOICE|HOME) && (type & (CELL|HOME) ) != (CELL|HOME) ) c.setHomePhone( value ); if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) c.setHomeFax( value ); if ( ( type & (CELL|HOME) ) == (CELL|HOME) ) c.setHomeMobile( value ); - if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) ) + if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) && (type & (CELL|WORK) ) != (CELL|WORK) ) c.setBusinessPhone( value ); if ( ( type & (FAX|WORK) ) == (FAX|WORK) ) c.setBusinessFax( value ); if ( ( type & (CELL|WORK) ) == (CELL|WORK) ) c.setBusinessMobile( value ); if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) ) c.setBusinessPager( value ); } } else if ( name == VCEmailAddressProp ) { QString email = vObjectStringZValue( o ); bool valid = TRUE; 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 @@ -49,27 +49,30 @@ namespace { name = vObjectStringZValue( ob ); qWarning("Categories:%s", name.data() ); } event.setUid( 1 ); return event; }; static VObject *vobjByEvent( const OTodo &event ) { VObject *task = newVObject( VCTodoProp ); if( task == 0 ) return 0l; - if( event.hasDueDate() ) + if( event.hasDueDate() ) { + QTime time(0, 0, 0); + QDateTime date(event.dueDate(), time ); addPropValue( task, VCDueProp, - TimeConversion::toISO8601( event.dueDate() ) ); + TimeConversion::toISO8601( date ) ); + } if( event.isCompleted() ) addPropValue( task, VCStatusProp, "COMPLETED"); QString string = QString::number(event.priority() ); addPropValue( task, VCPriorityProp, string.local8Bit() ); addPropValue( task, VCCategoriesProp, event.idsToString( event.categories() ).local8Bit() ); addPropValue( task, VCDescriptionProp, event.description().local8Bit() ); |