summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 6e482b5..e6bdde9 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2239,25 +2239,25 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString
anniversaryList.append(anni); //should be ISODate
realNameList.append((*it).realName());
preferredEmailList.append((*it).preferredEmail());
assembledNameList.append((*it).assembledName());
uidList.append((*it).uid());
- qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() );
+ //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() );
}
}
bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList);
}
/* this method will be called through the QCop interface from other apps to show details of a contact.
*/
void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
{
- qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
+ //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
QString foundUid = QString::null;
if ( ! uid.isEmpty() ) {
Addressee adrr = mAddressBook->findByUid( uid );
if ( !adrr.isEmpty() ) {
foundUid = uid;
@@ -2286,13 +2286,13 @@ void KABCore::requestForDetails(const QString& sourceChannel, const QString& ses
if (!name.isEmpty())
namelist = mAddressBook->findByName( name );
if (!email.isEmpty())
emaillist = mAddressBook->findByEmail( email );
- qDebug("count %d %d ", namelist.count(),emaillist.count() );
+ //qDebug("count %d %d ", namelist.count(),emaillist.count() );
//check if we have a match in Namelist and Emaillist
if ((namelist.count() == 0) && (emaillist.count() > 0)) {
foundUid = emaillist[0].uid();
}
else if ((namelist.count() > 0) && (emaillist.count() == 0))
foundUid = namelist[0].uid();
@@ -2403,30 +2403,30 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
bool remCh, locCh;
remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
- qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
+ //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
locCh = ( localMod > mLastAddressbookSync );
if ( !remCh && ! locCh ) {
- qDebug("both not changed ");
+ //qDebug("both not changed ");
lastSync = localMod.addDays(1);
if ( mode <= SYNC_PREF_ASK )
return 0;
} else {
if ( locCh ) {
- qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1());
+ //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1());
lastSync = localMod.addDays( -1 );
if ( !remCh )
remoteMod =( lastSync.addDays( -1 ) );
} else {
- qDebug(" not loc changed ");
+ //qDebug(" not loc changed ");
lastSync = localMod.addDays( 1 );
if ( remCh ) {
- qDebug("rem changed ");
+ //qDebug("rem changed ");
remoteMod =( lastSync.addDays( 1 ) );
}
}
}
full = true;
@@ -2434,19 +2434,19 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
mode = SYNC_PREF_ASK;
} else {
if ( localMod == remoteMod )
return 0;
}
- qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec());
- qDebug("lastsync %s ", lastSync.toString().latin1() );
+ //qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec());
+ //qDebug("lastsync %s ", lastSync.toString().latin1() );
//full = true; //debug only
if ( full ) {
bool equ = ( (*local) == (*remote) );
if ( equ ) {
- qDebug("equal ");
+ //qDebug("equal ");
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
}
if ( mode < SYNC_PREF_FORCE_LOCAL )
return 0;
@@ -2553,33 +2553,33 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
remote->removeAddressee(addresseeR );
} else {
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
addresseeRSync = addresseeLSync ;
} else {
- qDebug("FULLDATE 1");
+ //qDebug("FULLDATE 1");
fullDateRange = true;
Addressee newAdd;
addresseeRSync = newAdd;
addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee"));
addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName );
addresseeRSync.setRevision( mLastAddressbookSync );
addresseeRSync.setCategories( i18n("SyncAddressee") );
}
}
if ( addresseeLSync.revision() == mLastAddressbookSync ) {
- qDebug("FULLDATE 2");
+ // qDebug("FULLDATE 2");
fullDateRange = true;
}
if ( ! fullDateRange ) {
if ( addresseeLSync.revision() != addresseeRSync.revision() ) {
// qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() );
//qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec());
fullDateRange = true;
- qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() );
+ //qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() );
}
}
// fullDateRange = true; // debug only!
if ( fullDateRange )
mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365);
else
@@ -2853,12 +2853,13 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
}
}
}
setModified();
}
+ abLocal.removeResources();
if ( syncOK )
mViewManager->refreshView();
return syncOK;
}
void KABCore::removeSyncInfo( QString syncProfile)
@@ -2891,12 +2892,13 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
}
} else
message( i18n("Sync cancelled or failed.") );
setModified();
}
+ abLocal.removeResources();
if ( syncOK )
mViewManager->refreshView();
disableBR( false );
return syncOK;
}
@@ -2930,12 +2932,13 @@ bool KABCore::syncPhone()
//abLocal.preparePhoneSync( mCurrentSyncDevice, false );
abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
}
}
setModified();
}
+ abLocal.removeResources();
if ( syncOK )
mViewManager->refreshView();
return syncOK;
}
void KABCore::getFile( bool success )
{