|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
** Copyright (C) 2007 by Adriaan de Groot <groot@kde.org>
|
|
|
|
|
**
|
|
|
|
|
** The abbrowser conduit copies addresses from the Pilot's address book to
|
|
|
|
|
** the KDE addressbook maintained via the kabc library.
|
|
|
|
|
** the KDE addressbook maintained via the tdeabc library.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -49,7 +49,7 @@
|
|
|
|
|
#include "resolutionDialog.h"
|
|
|
|
|
#include "resolutionTable.h"
|
|
|
|
|
#include "abbrowserSettings.h"
|
|
|
|
|
#include "kabcRecord.h"
|
|
|
|
|
#include "tdeabcRecord.h"
|
|
|
|
|
|
|
|
|
|
#include "abbrowser-conduit.moc"
|
|
|
|
|
|
|
|
|
@ -765,7 +765,7 @@ void AbbrowserConduit::slotDeletedRecord()
|
|
|
|
|
Addressee e = aBook->findByUid(uid);
|
|
|
|
|
|
|
|
|
|
DEBUGKPILOT << fname << ": now looking at palm id: ["
|
|
|
|
|
<< id << "], kabc uid: [" << uid << "]." << endl;
|
|
|
|
|
<< id << "], tdeabc uid: [" << uid << "]." << endl;
|
|
|
|
|
|
|
|
|
|
PilotAddress*backupAddr=0L;
|
|
|
|
|
if (backupRec)
|
|
|
|
@ -1234,13 +1234,13 @@ bool AbbrowserConduit::_savePCAddr(Addressee &pcAddr, PilotAddress*,
|
|
|
|
|
long pilotIdL = pilotId.toLong();
|
|
|
|
|
if(!pilotId.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
// because we maintain a mapping between pilotId -> kabc uid, whenever we add
|
|
|
|
|
// because we maintain a mapping between pilotId -> tdeabc uid, whenever we add
|
|
|
|
|
// a new relationship, we have to remove any old mapping that would tie a different
|
|
|
|
|
// pilot id -> this kabc uid
|
|
|
|
|
// pilot id -> this tdeabc uid
|
|
|
|
|
TQMap < recordid_t, TQString>::iterator it;
|
|
|
|
|
for ( it = addresseeMap.begin(); it != addresseeMap.end(); ++it ) {
|
|
|
|
|
TQString kabcUid = it.data();
|
|
|
|
|
if (kabcUid == pcAddr.uid()) {
|
|
|
|
|
TQString tdeabcUid = it.data();
|
|
|
|
|
if (tdeabcUid == pcAddr.uid()) {
|
|
|
|
|
addresseeMap.remove(it);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -1348,7 +1348,7 @@ bool AbbrowserConduit::_equal(const PilotAddress *piAddress, const Addressee &ab
|
|
|
|
|
for (TQStringList::Iterator it = piEmails.begin(); it != piEmails.end(); it++) {
|
|
|
|
|
if (!abEmails.contains(*it))
|
|
|
|
|
{
|
|
|
|
|
DEBUGKPILOT << fname << ": kabc e-mail missing" << endl;
|
|
|
|
|
DEBUGKPILOT << fname << ": tdeabc e-mail missing" << endl;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1359,7 +1359,7 @@ bool AbbrowserConduit::_equal(const PilotAddress *piAddress, const Addressee &ab
|
|
|
|
|
|
|
|
|
|
PhoneNumber::List abPhones(abEntry.phoneNumbers());
|
|
|
|
|
PhoneNumber::List piPhones = TDEABCSync::getPhoneNumbers(*piAddress);
|
|
|
|
|
// first make sure that all of the pilot phone numbers are in kabc
|
|
|
|
|
// first make sure that all of the pilot phone numbers are in tdeabc
|
|
|
|
|
for (PhoneNumber::List::Iterator it = piPhones.begin(); it != piPhones.end(); it++) {
|
|
|
|
|
PhoneNumber piPhone = *it;
|
|
|
|
|
bool found=false;
|
|
|
|
@ -1375,11 +1375,11 @@ bool AbbrowserConduit::_equal(const PilotAddress *piAddress, const Addressee &ab
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!found) {
|
|
|
|
|
DEBUGKPILOT << fname << ": not equal because kabc phone not found." << endl;
|
|
|
|
|
DEBUGKPILOT << fname << ": not equal because tdeabc phone not found." << endl;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// now the other way. *cringe* kabc has the capacity to store way more addresses
|
|
|
|
|
// now the other way. *cringe* tdeabc has the capacity to store way more addresses
|
|
|
|
|
// than the Pilot, so this might give false positives more than we'd want....
|
|
|
|
|
for (PhoneNumber::List::Iterator it = abPhones.begin(); it != abPhones.end(); it++) {
|
|
|
|
|
PhoneNumber abPhone = *it;
|
|
|
|
|