summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/sharpdtm/sharpdtmconverter.cpp
authorzautrix <zautrix>2004-09-20 18:59:02 (UTC)
committer zautrix <zautrix>2004-09-20 18:59:02 (UTC)
commit138be6cfa921cd8a07fa0b18046d955e7d2dbd6e (patch) (side-by-side diff)
tree67b8b69e26641f4f048ce19e05b361f5aea6db85 /kabc/plugins/sharpdtm/sharpdtmconverter.cpp
parent6b6a28919908134ccbb3badcb24c2dcae0d426a5 (diff)
downloadkdepimpi-138be6cfa921cd8a07fa0b18046d955e7d2dbd6e.zip
kdepimpi-138be6cfa921cd8a07fa0b18046d955e7d2dbd6e.tar.gz
kdepimpi-138be6cfa921cd8a07fa0b18046d955e7d2dbd6e.tar.bz2
more DTM sync
Diffstat (limited to 'kabc/plugins/sharpdtm/sharpdtmconverter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/sharpdtm/sharpdtmconverter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/kabc/plugins/sharpdtm/sharpdtmconverter.cpp b/kabc/plugins/sharpdtm/sharpdtmconverter.cpp
index 8f8334e..b065bf3 100644
--- a/kabc/plugins/sharpdtm/sharpdtmconverter.cpp
+++ b/kabc/plugins/sharpdtm/sharpdtmconverter.cpp
@@ -48,48 +48,54 @@ SharpDTMConverter::~SharpDTMConverter()
bool SharpDTMConverter::init()
{
catDB = new SlCategory::SlCategories();
if (!catDB)
return false;
// catDB->load( categoryFileName() );
return true;
}
void SharpDTMConverter::deinit()
{
if (catDB)
{
delete catDB;
catDB = 0;
}
}
bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBase* database, Addressee &addr )
{
SlZDataBase* db = (SlZDataBase*)database;
+
+ // for syncing: we need setting of the two fields
+ addr.setExternalUID( QString::number( contact ) );
+ addr.setOriginalExternalUID( QString::number( contact ) );
+
+
// name
qDebug("SharpDTMConverter::sharpToAddressee check if the fileAs transformation works!!");
addr.setFormattedName(db->readField(ZdbAdrs::FileAs));
addr.setFamilyName( db->readField(ZdbAdrs::LastName) );
addr.setGivenName( db->readField(ZdbAdrs::FirstName) );
addr.setAdditionalName( db->readField(ZdbAdrs::MiddleName) );
addr.setPrefix( db->readField(ZdbAdrs::Title) );
addr.setSuffix( db->readField(ZdbAdrs::Suffix) );
// email
QString emailstr = db->readField(ZdbAdrs::Emails);
qDebug("SharpDTMConverter::sharpToAddressee whats the character to seperate the emailadresses? %s ", emailstr.latin1());
QStringList emails = QStringList::split(",", emailstr);
for ( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) {
addr.insertEmail( *it, ((*it) == db->readField(ZdbAdrs::DefaultEmail)) );
}
if (!db->readField(ZdbAdrs::DefaultEmail).isEmpty())
addr.insertEmail(db->readField(ZdbAdrs::DefaultEmail), true);
// home