summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/file/resourcefile.cpp3
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.cpp48
-rw-r--r--kabc/plugins/sharpdtm/sharpdtmconverter.cpp17
-rw-r--r--kaddressbook/kabcore.cpp5
-rw-r--r--korganizer/calendarview.cpp4
5 files changed, 70 insertions, 7 deletions
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp
index b8c32d5..6cd63fd 100644
--- a/kabc/plugins/file/resourcefile.cpp
+++ b/kabc/plugins/file/resourcefile.cpp
@@ -165,2 +165,3 @@ bool ResourceFile::doOpen()
165 QFile file( mFileName ); 165 QFile file( mFileName );
166 qDebug("ResourceFile::openfile %s ", mFileName.latin1());
166 167
@@ -196,3 +197,3 @@ bool ResourceFile::load()
196 197
197 198 qDebug("ResourceFile::loadfile %s ", mFileName.latin1());
198 QFile file( mFileName ); 199 QFile file( mFileName );
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
index 48d3985..437bda8 100644
--- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
+++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
@@ -206,2 +206,5 @@ bool ResourceSharpDTM::save( Ticket *ticket )
206 KABC::Addressee::List changedAddressees; 206 KABC::Addressee::List changedAddressees;
207 typedef QMap<int,QString> AddresseeMap;
208 AddresseeMap map;
209 CardId id ;
207 210
@@ -211,3 +214,2 @@ bool ResourceSharpDTM::save( Ticket *ticket )
211 QString uid = (*it).originalExternalUID(); 214 QString uid = (*it).originalExternalUID();
212 CardId id ;
213 bool res; 215 bool res;
@@ -225,2 +227,9 @@ bool ResourceSharpDTM::save( Ticket *ticket )
225 { 227 {
228 res = mAccess->finishEditCard(&id);
229 //(*it).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
230 //(*it).setExternalUID( QString::number( id ) );
231 //(*it).setOriginalExternalUID( QString::number( id ) );
232 map.insert(id,(*it).uid());
233
234#if 0
226 KABC::Addressee addressee; 235 KABC::Addressee addressee;
@@ -228,3 +237,3 @@ bool ResourceSharpDTM::save( Ticket *ticket )
228 addressee.setUid((*it).uid() ); 237 addressee.setUid((*it).uid() );
229 addressee.setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); 238 (it*).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
230 res = mAccess->finishEditCard(&id); 239 res = mAccess->finishEditCard(&id);
@@ -234,2 +243,3 @@ bool ResourceSharpDTM::save( Ticket *ticket )
234 changedAddressees.append( addressee ); 243 changedAddressees.append( addressee );
244#endif
235 245
@@ -263,2 +273,7 @@ bool ResourceSharpDTM::save( Ticket *ticket )
263 { 273 {
274 res = mAccess->finishEditCard(&id);
275 //(*it).setTempSyncStat( SYNC_TEMPSTATE_NEW_CSUM );
276 map.insert(id,(*it).uid());
277
278#if 0
264 KABC::Addressee addressee; 279 KABC::Addressee addressee;
@@ -269,2 +284,3 @@ bool ResourceSharpDTM::save( Ticket *ticket )
269 res = mAccess->finishEditCard(&id); 284 res = mAccess->finishEditCard(&id);
285#endif
270 if (res == false) 286 if (res == false)
@@ -283,5 +299,31 @@ bool ResourceSharpDTM::save( Ticket *ticket )
283 } 299 }
300 AddresseeMap::Iterator itam;
301 res;
302 for ( res=mAccess->first(); res == true; res=mAccess->next())
303 {
304 id = mAccess->cardId();
305 int idint = id;
306 itam = map.find( idint );
307 if ( itam != map.end() ) {
308 KABC::Addressee addressee;
309 qDebug("found change %d %s ", idint, itam.data().latin1());
310 res = mConverter->sharpToAddressee( id, mAccess, addressee );
311
312 if ( !addressee.isEmpty() && res )
313 {
314 addressee.setResource( this );
315 addressee.setUid( itam.data() );
316 addressee.setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
317 addressBook()->insertAddressee( addressee , false );
318 }
319 }
320 }
321#if 0
284 KABC::Addressee::List::Iterator it2; 322 KABC::Addressee::List::Iterator it2;
285 for ( it2 = changedAddressees.begin(); it2 != changedAddressees.end(); ++it2 ) 323 for ( it2 = changedAddressees.begin(); it2 != changedAddressees.end(); ++it2 ) {
324 (*it2).computeCsum( "Sharp_DTM" );
325 qDebug("CSUM: %s ",(*it2).getCsum( "Sharp_DTM" ).latin1() );
286 addressBook()->insertAddressee((*it2)); 326 addressBook()->insertAddressee((*it2));
327 }
328#endif
287 //US mAccess->save(); 329 //US mAccess->save();
diff --git a/kabc/plugins/sharpdtm/sharpdtmconverter.cpp b/kabc/plugins/sharpdtm/sharpdtmconverter.cpp
index f3bf2c5..fccf625 100644
--- a/kabc/plugins/sharpdtm/sharpdtmconverter.cpp
+++ b/kabc/plugins/sharpdtm/sharpdtmconverter.cpp
@@ -288,4 +288,15 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da
288 //qDebug("SharpDTMConverter::addresseeToSharp check if the fileAs transformation works!!\n%s",addr.formattedName().latin1() ); 288 //qDebug("SharpDTMConverter::addresseeToSharp check if the fileAs transformation works!!\n%s",addr.formattedName().latin1() );
289 database->writeField(ZdbAdrs::FileAs, addr.formattedName()); 289 QString formattedName = addr.formattedName();
290 database->writeField(ZdbAdrs::FullName, addr.formattedName()); 290 if ( formattedName.isEmpty() ) {
291 if ( !addr.familyName().isEmpty() ) {
292 formattedName = addr.familyName();
293 if ( !addr.givenName().isEmpty() ) {
294 formattedName += ", ";
295 formattedName += addr.givenName();
296 }
297 } else
298 formattedName = addr.givenName();
299 }
300 database->writeField(ZdbAdrs::FileAs, formattedName);
301 database->writeField(ZdbAdrs::FullName, formattedName);
291 302
@@ -351,3 +362,3 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da
351 PhoneNumber mobile = addr.phoneNumber( PhoneNumber::Cell ); 362 PhoneNumber mobile = addr.phoneNumber( PhoneNumber::Cell );
352 if (!businessmobile.number().isEmpty()) { 363 if (! mobile.number().isEmpty()) {
353 if ( ! cellHome ) 364 if ( ! cellHome )
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index c1ead9d..c2f031a 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2771,2 +2771,3 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2771 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 2771 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
2772 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
2772 local->insertAddressee( inL, false ); 2773 local->insertAddressee( inL, false );
@@ -2798,2 +2799,6 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2798 inL.setIDStr( idS ); 2799 inL.setIDStr( idS );
2800 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2801 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
2802 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
2803 }
2799 inL.setResource( 0 ); 2804 inL.setResource( 0 );
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index bbed05b..7fae4a9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1051,2 +1051,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1051 inL->setIDStr( idS ); 1051 inL->setIDStr( idS );
1052 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1053 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1054 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1055 }
1052 local->addIncidence( inL ); 1056 local->addIncidence( inL );