summaryrefslogtreecommitdiff
path: root/libopie/pim/ocontactaccessbackend_vcard.cpp
authorzecke <zecke>2003-02-16 22:25:46 (UTC)
committer zecke <zecke>2003-02-16 22:25:46 (UTC)
commit4d0e8ffd8518fe24ed94cfcf92eeff666b014094 (patch) (side-by-side diff)
tree86a0bec752418c409cbc9ad95d6479997dfaf909 /libopie/pim/ocontactaccessbackend_vcard.cpp
parent8ecc375c803dc57b160bd0335891fcaf4f6de1df (diff)
downloadopie-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
Diffstat (limited to 'libopie/pim/ocontactaccessbackend_vcard.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontactaccessbackend_vcard.cpp82
1 files changed, 49 insertions, 33 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
@@ -19,2 +19,17 @@
* $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
@@ -55,6 +70,6 @@ OContactAccessBackend_VCard::OContactAccessBackend_VCard ( QString , QString fil
bool OContactAccessBackend_VCard::load ()
-{
+{
m_map.clear();
m_dirty = false;
-
+
VObject* obj = 0l;
@@ -83,3 +98,3 @@ bool OContactAccessBackend_VCard::load ()
m_map.insert( con.uid(), con );
-
+
VObject *t = obj;
@@ -97,3 +112,3 @@ bool OContactAccessBackend_VCard::reload()
bool OContactAccessBackend_VCard::save()
-{
+{
if (!m_dirty )
@@ -119,3 +134,3 @@ bool OContactAccessBackend_VCard::save()
return true;
-
+
@@ -139,3 +154,3 @@ bool OContactAccessBackend_VCard::remove ( int uid )
m_dirty = true;
- return true;
+ return true;
}
@@ -148,3 +163,3 @@ bool OContactAccessBackend_VCard::replace ( const OContact &contact )
}
-
+
OContact OContactAccessBackend_VCard::find ( int uid ) const
@@ -208,3 +223,3 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
OContact c;
-
+
VObjectIterator it;
@@ -241,3 +256,3 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
QString country;
-
+
VObjectIterator nit;
@@ -288,3 +303,3 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
int type = 0;
-
+
VObjectIterator nit;
@@ -316,4 +331,5 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
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 );
@@ -323,3 +339,3 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
c.setHomeMobile( value );
- if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) )
+ if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) && (type & (CELL|WORK) ) != (CELL|WORK) )
c.setBusinessPhone( value );
@@ -408,5 +424,5 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
c.setBirthday( convVCardDateToDate( value ) );
-
+
}
-
+
#if 0
@@ -436,6 +452,6 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
safeAddPropValue( vcard, VCUniqueStringProp, QString::number(c.uid()) );
-
+
// full name
safeAddPropValue( vcard, VCFullNameProp, c.fullName() );
-
+
// name properties
@@ -447,3 +463,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
safeAddPropValue( name, VCNameSuffixesProp, c.suffix() );
-
+
// home properties
@@ -456,3 +472,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
safeAddPropValue( home_adr, VCCountryNameProp, c.homeCountry() );
-
+
VObject *home_phone = safeAddPropValue( vcard, VCTelephoneProp, c.homePhone() );
@@ -465,6 +481,6 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
safeAddProp( home_phone, VCFaxProp );
-
+
VObject *url = safeAddPropValue( vcard, VCURLProp, c.homeWebpage() );
safeAddProp( url, VCHomeProp );
-
+
// work properties
@@ -477,3 +493,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() );
-
+
VObject *work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessPhone() );
@@ -489,10 +505,10 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
safeAddProp( work_phone, VCPagerProp );
-
+
url = safeAddPropValue( vcard, VCURLProp, c.businessWebpage() );
safeAddProp( url, VCWorkProp );
-
+
VObject *title = safeAddPropValue( vcard, VCTitleProp, c.jobTitle() );
safeAddProp( title, VCWorkProp );
-
-
+
+
QStringList emails = c.emailList();
@@ -503,5 +519,5 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
}
-
+
safeAddPropValue( vcard, VCNoteProp, c.notes() );
-
+
// Exporting Birthday regarding RFC 2425 (5.8.4)
@@ -511,3 +527,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
}
-
+
if ( !c.company().isEmpty() || !c.department().isEmpty() || !c.office().isEmpty() ) {
@@ -518,3 +534,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
}
-
+
// some values we have to export as custom fields
@@ -523,3 +539,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
safeAddPropValue( vcard, "X-Qtopia-Assistant", c.assistant() );
-
+
safeAddPropValue( vcard, "X-Qtopia-Spouse", c.spouse() );
@@ -532,3 +548,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
safeAddPropValue( vcard, "X-Qtopia-Children", c.children() );
-
+
return vcard;
@@ -546,3 +562,3 @@ QString OContactAccessBackend_VCard::convDateToVCardDate( const QDate& d ) const
str_rfc2425.replace( pos, 1, "0" );
-
+
return str_rfc2425;