summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/ocontact.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/ocontact.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/ocontact.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp
index cd238ef..8a0930b 100644
--- a/libopie2/opiepim/ocontact.cpp
+++ b/libopie2/opiepim/ocontact.cpp
@@ -27,49 +27,48 @@
#include <qpe/stringutil.h>
#include <qpe/timeconversion.h>
#include <qpe/timestring.h>
#include <qobject.h>
#include <qregexp.h>
#include <qstylesheet.h>
#include <qfileinfo.h>
#include <qmap.h>
#include <stdio.h>
/*!
\class Contact contact.h
\brief The Contact class holds the data of an address book entry.
This data includes information the name of the person, contact
information, and business information such as deparment and job title.
\ingroup qtopiaemb
\ingroup qtopiadesktop
*/
-Qtopia::UidGen OContact::sUidGen( Qtopia::UidGen::Qtopia );
/*!
Creates a new, empty contact.
*/
OContact::OContact()
: OPimRecord(), mMap(), d( 0 )
{
}
/*!
\internal
Creates a new contact. The properties of the contact are
set from \a fromMap.
*/
OContact::OContact( const QMap<int, QString> &fromMap ) :
OPimRecord(), mMap( fromMap ), d( 0 )
{
QString cats = mMap[ Qtopia::AddressCategory ];
if ( !cats.isEmpty() )
setCategories( idsFromString( cats ) );
QString uidStr = find( Qtopia::AddressUid );
if ( uidStr.isEmpty() || (uidStr.toInt() == 0) ){
@@ -1449,50 +1448,52 @@ void OContact::writeVCard( const QString &filename, const OContact &contact)
cleanVObject( obj );
cleanStrTbl();
}
/*!
Returns the set of contacts read as VCards from the file \a filename.
*/
QValueList<OContact> OContact::readVCard( const QString &filename )
{
qDebug("trying to open %s, exists=%d", filename.utf8().data(), QFileInfo( filename.utf8().data() ).size() );
VObject *obj = Parse_MIME_FromFileName( (char *)filename.utf8().data() );
qDebug("vobject = %p", obj );
QValueList<OContact> contacts;
while ( obj ) {
OContact con = parseVObject( obj );
/*
* if uid is 0 assign a new one
* this at least happens on
* Nokia6210
*/
- if ( con.uid() == 0 )
+ if ( con.uid() == 0 ){
con.setUid( 1 );
+ qWarning("assigned new uid %d",con.uid() );
+ }
contacts.append(con );
VObject *t = obj;
obj = nextVObjectInList(obj);
cleanVObject( t );
}
return contacts;
}
/*!
Returns TRUE if the contact matches the regular expression \a regexp.
Otherwise returns FALSE.
*/
bool OContact::match( const QString &regexp ) const
{
return match(QRegExp(regexp));
}
/*!
\overload
Returns TRUE if the contact matches the regular expression \a regexp.
Otherwise returns FALSE.