summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/ocontact.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/ocontact.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/ocontact.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp
index acd65c4..cd238ef 100644
--- a/libopie2/opiepim/ocontact.cpp
+++ b/libopie2/opiepim/ocontact.cpp
@@ -1455,25 +1455,34 @@ void OContact::writeVCard( const QString &filename, const OContact &contact)
1455 Returns the set of contacts read as VCards from the file \a filename. 1455 Returns the set of contacts read as VCards from the file \a filename.
1456*/ 1456*/
1457QValueList<OContact> OContact::readVCard( const QString &filename ) 1457QValueList<OContact> OContact::readVCard( const QString &filename )
1458{ 1458{
1459 qDebug("trying to open %s, exists=%d", filename.utf8().data(), QFileInfo( filename.utf8().data() ).size() ); 1459 qDebug("trying to open %s, exists=%d", filename.utf8().data(), QFileInfo( filename.utf8().data() ).size() );
1460 VObject *obj = Parse_MIME_FromFileName( (char *)filename.utf8().data() ); 1460 VObject *obj = Parse_MIME_FromFileName( (char *)filename.utf8().data() );
1461 1461
1462 qDebug("vobject = %p", obj ); 1462 qDebug("vobject = %p", obj );
1463 1463
1464 QValueList<OContact> contacts; 1464 QValueList<OContact> contacts;
1465 1465
1466 while ( obj ) { 1466 while ( obj ) {
1467 contacts.append( parseVObject( obj ) ); 1467 OContact con = parseVObject( obj );
1468 /*
1469 * if uid is 0 assign a new one
1470 * this at least happens on
1471 * Nokia6210
1472 */
1473 if ( con.uid() == 0 )
1474 con.setUid( 1 );
1475
1476 contacts.append(con );
1468 1477
1469 VObject *t = obj; 1478 VObject *t = obj;
1470 obj = nextVObjectInList(obj); 1479 obj = nextVObjectInList(obj);
1471 cleanVObject( t ); 1480 cleanVObject( t );
1472 } 1481 }
1473 1482
1474 return contacts; 1483 return contacts;
1475} 1484}
1476 1485
1477/*! 1486/*!
1478 Returns TRUE if the contact matches the regular expression \a regexp. 1487 Returns TRUE if the contact matches the regular expression \a regexp.
1479 Otherwise returns FALSE. 1488 Otherwise returns FALSE.