|
|
@ -45,9 +45,9 @@
|
|
|
|
* types. Email addresses are NOT included in this map, and are handled
|
|
|
|
* types. Email addresses are NOT included in this map, and are handled
|
|
|
|
* separately (not in PhoneNumber at all). The Pilot has 8 different kinds
|
|
|
|
* separately (not in PhoneNumber at all). The Pilot has 8 different kinds
|
|
|
|
* of phone numbers (which may be *labeled* however you like). These
|
|
|
|
* of phone numbers (which may be *labeled* however you like). These
|
|
|
|
* need to be mapped to the things that KABC::PhoneNumber handles.
|
|
|
|
* need to be mapped to the things that TDEABC::PhoneNumber handles.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* From KABC::PhoneNumber
|
|
|
|
* From TDEABC::PhoneNumber
|
|
|
|
* enum Types { Home = 1, Work = 2, Msg = 4, Pref = 8, Voice = 16, Fax = 32,
|
|
|
|
* enum Types { Home = 1, Work = 2, Msg = 4, Pref = 8, Voice = 16, Fax = 32,
|
|
|
|
* Cell = 64, Video = 128, Bbs = 256, Modem = 512, Car = 1024,
|
|
|
|
* Cell = 64, Video = 128, Bbs = 256, Modem = 512, Car = 1024,
|
|
|
|
* Isdn = 2048, Pcs = 4096, Pager = 8192 };
|
|
|
|
* Isdn = 2048, Pcs = 4096, Pager = 8192 };
|
|
|
@ -60,25 +60,25 @@
|
|
|
|
* };
|
|
|
|
* };
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* This array must have as many elements as PilotAddress::PhoneType
|
|
|
|
* This array must have as many elements as PilotAddress::PhoneType
|
|
|
|
* and its elements must be KABC::PhoneNumber::Types.
|
|
|
|
* and its elements must be TDEABC::PhoneNumber::Types.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
static KABC::PhoneNumber::Types pilotToPhoneMap[8] = {
|
|
|
|
static TDEABC::PhoneNumber::Types pilotToPhoneMap[8] = {
|
|
|
|
KABC::PhoneNumber::Work, // eWork
|
|
|
|
TDEABC::PhoneNumber::Work, // eWork
|
|
|
|
KABC::PhoneNumber::Home, // eHome,
|
|
|
|
TDEABC::PhoneNumber::Home, // eHome,
|
|
|
|
KABC::PhoneNumber::Fax, // eFax,
|
|
|
|
TDEABC::PhoneNumber::Fax, // eFax,
|
|
|
|
(KABC::PhoneNumber::Types)0, // eOther -> wasn't mapped properly,
|
|
|
|
(TDEABC::PhoneNumber::Types)0, // eOther -> wasn't mapped properly,
|
|
|
|
(KABC::PhoneNumber::Types)0, // eEmail -> shouldn't occur,
|
|
|
|
(TDEABC::PhoneNumber::Types)0, // eEmail -> shouldn't occur,
|
|
|
|
KABC::PhoneNumber::Home, // eMain
|
|
|
|
TDEABC::PhoneNumber::Home, // eMain
|
|
|
|
KABC::PhoneNumber::Pager, // ePager,
|
|
|
|
TDEABC::PhoneNumber::Pager, // ePager,
|
|
|
|
KABC::PhoneNumber::Cell // eMobile
|
|
|
|
TDEABC::PhoneNumber::Cell // eMobile
|
|
|
|
} ;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
KABC::PhoneNumber::List KABCSync::getPhoneNumbers(const PilotAddress &a)
|
|
|
|
TDEABC::PhoneNumber::List KABCSync::getPhoneNumbers(const PilotAddress &a)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FUNCTIONSETUP;
|
|
|
|
FUNCTIONSETUP;
|
|
|
|
|
|
|
|
|
|
|
|
KABC::PhoneNumber::List list;
|
|
|
|
TDEABC::PhoneNumber::List list;
|
|
|
|
TQString test;
|
|
|
|
TQString test;
|
|
|
|
|
|
|
|
|
|
|
|
PhoneSlot shownPhone = a.getShownPhone();
|
|
|
|
PhoneSlot shownPhone = a.getShownPhone();
|
|
|
@ -110,11 +110,11 @@ KABC::PhoneNumber::List KABCSync::getPhoneNumbers(const PilotAddress &a)
|
|
|
|
// if this is the preferred phone number, set it as such
|
|
|
|
// if this is the preferred phone number, set it as such
|
|
|
|
if (shownPhone == i)
|
|
|
|
if (shownPhone == i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
phoneType |= KABC::PhoneNumber::Pref;
|
|
|
|
phoneType |= TDEABC::PhoneNumber::Pref;
|
|
|
|
DEBUGKPILOT << fname << ": found preferred pilot index: ["
|
|
|
|
DEBUGKPILOT << fname << ": found preferred pilot index: ["
|
|
|
|
<< i << "], text: [" << test << "]" << endl;
|
|
|
|
<< i << "], text: [" << test << "]" << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
KABC::PhoneNumber ph(test, phoneType);
|
|
|
|
TDEABC::PhoneNumber ph(test, phoneType);
|
|
|
|
list.append(ph);
|
|
|
|
list.append(ph);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -133,7 +133,7 @@ KABC::PhoneNumber::List KABCSync::getPhoneNumbers(const PilotAddress &a)
|
|
|
|
|
|
|
|
|
|
|
|
void KABCSync::setPhoneNumbers(const PilotAddressInfo &info,
|
|
|
|
void KABCSync::setPhoneNumbers(const PilotAddressInfo &info,
|
|
|
|
PilotAddress &a,
|
|
|
|
PilotAddress &a,
|
|
|
|
const KABC::PhoneNumber::List &list)
|
|
|
|
const TDEABC::PhoneNumber::List &list)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FUNCTIONSETUP;
|
|
|
|
FUNCTIONSETUP;
|
|
|
|
TQString test;
|
|
|
|
TQString test;
|
|
|
@ -151,10 +151,10 @@ void KABCSync::setPhoneNumbers(const PilotAddressInfo &info,
|
|
|
|
// now iterate through the list and for each PhoneNumber in the list,
|
|
|
|
// now iterate through the list and for each PhoneNumber in the list,
|
|
|
|
// iterate through our phone types using our map and set the first one
|
|
|
|
// iterate through our phone types using our map and set the first one
|
|
|
|
// we find as the type of address for the Pilot
|
|
|
|
// we find as the type of address for the Pilot
|
|
|
|
for(KABC::PhoneNumber::List::ConstIterator listIter = list.begin();
|
|
|
|
for(TDEABC::PhoneNumber::List::ConstIterator listIter = list.begin();
|
|
|
|
listIter != list.end(); ++listIter)
|
|
|
|
listIter != list.end(); ++listIter)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::PhoneNumber phone = *listIter;
|
|
|
|
TDEABC::PhoneNumber phone = *listIter;
|
|
|
|
|
|
|
|
|
|
|
|
PilotAddressInfo::EPhoneType phoneType = PilotAddressInfo::eHome;
|
|
|
|
PilotAddressInfo::EPhoneType phoneType = PilotAddressInfo::eHome;
|
|
|
|
|
|
|
|
|
|
|
@ -179,7 +179,7 @@ void KABCSync::setPhoneNumbers(const PilotAddressInfo &info,
|
|
|
|
a.setPhoneField(phoneType, phone.number(), PilotAddress::NoFlags);
|
|
|
|
a.setPhoneField(phoneType, phone.number(), PilotAddress::NoFlags);
|
|
|
|
|
|
|
|
|
|
|
|
// if this is the preferred phone number, then set it as such
|
|
|
|
// if this is the preferred phone number, then set it as such
|
|
|
|
if (fieldSlot.isValid() && (phone.type() & KABC::PhoneNumber::Pref))
|
|
|
|
if (fieldSlot.isValid() && (phone.type() & TDEABC::PhoneNumber::Pref))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DEBUGKPILOT << fname << ": found preferred PhoneNumber. "
|
|
|
|
DEBUGKPILOT << fname << ": found preferred PhoneNumber. "
|
|
|
|
<< "setting showPhone to index: ["
|
|
|
|
<< "setting showPhone to index: ["
|
|
|
@ -258,7 +258,7 @@ unsigned int KABCSync::bestMatchedCategory(const TQStringList &pccategories,
|
|
|
|
return Pilot::Unfiled;
|
|
|
|
return Pilot::Unfiled;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KABCSync::setCategory(KABC::Addressee & abEntry, const TQString &cat)
|
|
|
|
void KABCSync::setCategory(TDEABC::Addressee & abEntry, const TQString &cat)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( (!cat.isEmpty()))
|
|
|
|
if ( (!cat.isEmpty()))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -269,7 +269,7 @@ void KABCSync::setCategory(KABC::Addressee & abEntry, const TQString &cat)
|
|
|
|
|
|
|
|
|
|
|
|
TQString KABCSync::getFieldForHHCustom(
|
|
|
|
TQString KABCSync::getFieldForHHCustom(
|
|
|
|
const unsigned int index,
|
|
|
|
const unsigned int index,
|
|
|
|
const KABC::Addressee &abEntry,
|
|
|
|
const TDEABC::Addressee &abEntry,
|
|
|
|
const KABCSync::Settings &settings)
|
|
|
|
const KABCSync::Settings &settings)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FUNCTIONSETUPL(4);
|
|
|
|
FUNCTIONSETUPL(4);
|
|
|
@ -320,7 +320,7 @@ TQString KABCSync::getFieldForHHCustom(
|
|
|
|
|
|
|
|
|
|
|
|
void KABCSync::setFieldFromHHCustom(
|
|
|
|
void KABCSync::setFieldFromHHCustom(
|
|
|
|
const unsigned int index,
|
|
|
|
const unsigned int index,
|
|
|
|
KABC::Addressee &abEntry,
|
|
|
|
TDEABC::Addressee &abEntry,
|
|
|
|
const TQString &value,
|
|
|
|
const TQString &value,
|
|
|
|
const KABCSync::Settings &settings)
|
|
|
|
const KABCSync::Settings &settings)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -392,31 +392,31 @@ void KABCSync::setFieldFromHHCustom(
|
|
|
|
* for home or work as specified in the config dialog. If we don't have
|
|
|
|
* for home or work as specified in the config dialog. If we don't have
|
|
|
|
* such one, either, search for the other type. If we still have no luck,
|
|
|
|
* such one, either, search for the other type. If we still have no luck,
|
|
|
|
* return an address with preferred + home/work flag (from config dlg). */
|
|
|
|
* return an address with preferred + home/work flag (from config dlg). */
|
|
|
|
KABC::Address KABCSync::getAddress(const KABC::Addressee &abEntry, const KABCSync::Settings &s)
|
|
|
|
TDEABC::Address KABCSync::getAddress(const TDEABC::Addressee &abEntry, const KABCSync::Settings &s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// preferhome == (AbbrowserSettings::pilotStreet==0)
|
|
|
|
// preferhome == (AbbrowserSettings::pilotStreet==0)
|
|
|
|
|
|
|
|
|
|
|
|
// Check for preferred address first
|
|
|
|
// Check for preferred address first
|
|
|
|
KABC::Address ad(abEntry.address(KABC::Address::Pref));
|
|
|
|
TDEABC::Address ad(abEntry.address(TDEABC::Address::Pref));
|
|
|
|
if (!ad.isEmpty()) return ad;
|
|
|
|
if (!ad.isEmpty()) return ad;
|
|
|
|
|
|
|
|
|
|
|
|
// Look for home or work, whichever is preferred
|
|
|
|
// Look for home or work, whichever is preferred
|
|
|
|
int type = s.preferHome() ? KABC::Address::Home : KABC::Address::Work;
|
|
|
|
int type = s.preferHome() ? TDEABC::Address::Home : TDEABC::Address::Work;
|
|
|
|
ad=abEntry.address(type);
|
|
|
|
ad=abEntry.address(type);
|
|
|
|
if (!ad.isEmpty()) return ad;
|
|
|
|
if (!ad.isEmpty()) return ad;
|
|
|
|
|
|
|
|
|
|
|
|
// Switch preference if still none found
|
|
|
|
// Switch preference if still none found
|
|
|
|
type = !s.preferHome() ? KABC::Address::Home : KABC::Address::Work;
|
|
|
|
type = !s.preferHome() ? TDEABC::Address::Home : TDEABC::Address::Work;
|
|
|
|
ad=abEntry.address(type);
|
|
|
|
ad=abEntry.address(type);
|
|
|
|
if (!ad.isEmpty()) return ad;
|
|
|
|
if (!ad.isEmpty()) return ad;
|
|
|
|
|
|
|
|
|
|
|
|
// Last-ditch attempt; see if there is a preferred home or work address
|
|
|
|
// Last-ditch attempt; see if there is a preferred home or work address
|
|
|
|
type = s.preferHome() ? KABC::Address::Home : KABC::Address::Work;
|
|
|
|
type = s.preferHome() ? TDEABC::Address::Home : TDEABC::Address::Work;
|
|
|
|
return abEntry.address(type | KABC::Address::Pref);
|
|
|
|
return abEntry.address(type | TDEABC::Address::Pref);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQString KABCSync::getFieldForHHOtherPhone(const KABC::Addressee & abEntry, const KABCSync::Settings &s)
|
|
|
|
TQString KABCSync::getFieldForHHOtherPhone(const TDEABC::Addressee & abEntry, const KABCSync::Settings &s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch(s.fieldForOtherPhone())
|
|
|
|
switch(s.fieldForOtherPhone())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -425,23 +425,23 @@ TQString KABCSync::getFieldForHHOtherPhone(const KABC::Addressee & abEntry, cons
|
|
|
|
case eAssistant:
|
|
|
|
case eAssistant:
|
|
|
|
return abEntry.custom(CSL1("KADDRESSBOOK"), CSL1("AssistantsName"));
|
|
|
|
return abEntry.custom(CSL1("KADDRESSBOOK"), CSL1("AssistantsName"));
|
|
|
|
case eBusinessFax:
|
|
|
|
case eBusinessFax:
|
|
|
|
return abEntry.phoneNumber(KABC::PhoneNumber::Fax | KABC::PhoneNumber::Work).number();
|
|
|
|
return abEntry.phoneNumber(TDEABC::PhoneNumber::Fax | TDEABC::PhoneNumber::Work).number();
|
|
|
|
case eCarPhone:
|
|
|
|
case eCarPhone:
|
|
|
|
return abEntry.phoneNumber(KABC::PhoneNumber::Car).number();
|
|
|
|
return abEntry.phoneNumber(TDEABC::PhoneNumber::Car).number();
|
|
|
|
case eEmail2:
|
|
|
|
case eEmail2:
|
|
|
|
return abEntry.emails().first();
|
|
|
|
return abEntry.emails().first();
|
|
|
|
case eHomeFax:
|
|
|
|
case eHomeFax:
|
|
|
|
return abEntry.phoneNumber(KABC::PhoneNumber::Fax | KABC::PhoneNumber::Home).number();
|
|
|
|
return abEntry.phoneNumber(TDEABC::PhoneNumber::Fax | TDEABC::PhoneNumber::Home).number();
|
|
|
|
case eTelex:
|
|
|
|
case eTelex:
|
|
|
|
return abEntry.phoneNumber(KABC::PhoneNumber::Bbs).number();
|
|
|
|
return abEntry.phoneNumber(TDEABC::PhoneNumber::Bbs).number();
|
|
|
|
case eTTYTTDPhone:
|
|
|
|
case eTTYTTDPhone:
|
|
|
|
return abEntry.phoneNumber(KABC::PhoneNumber::Pcs).number();
|
|
|
|
return abEntry.phoneNumber(TDEABC::PhoneNumber::Pcs).number();
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return TQString();
|
|
|
|
return TQString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KABCSync::setFieldFromHHOtherPhone(KABC::Addressee & abEntry, const TQString &nr, const KABCSync::Settings &s)
|
|
|
|
void KABCSync::setFieldFromHHOtherPhone(TDEABC::Addressee & abEntry, const TQString &nr, const KABCSync::Settings &s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int phoneType = 0;
|
|
|
|
int phoneType = 0;
|
|
|
|
switch (s.fieldForOtherPhone())
|
|
|
|
switch (s.fieldForOtherPhone())
|
|
|
@ -459,32 +459,32 @@ void KABCSync::setFieldFromHHOtherPhone(KABC::Addressee & abEntry, const TQStrin
|
|
|
|
phoneType = 0;
|
|
|
|
phoneType = 0;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case eBusinessFax:
|
|
|
|
case eBusinessFax:
|
|
|
|
phoneType = KABC::PhoneNumber::Fax | KABC::PhoneNumber::Work;
|
|
|
|
phoneType = TDEABC::PhoneNumber::Fax | TDEABC::PhoneNumber::Work;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case eHomeFax:
|
|
|
|
case eHomeFax:
|
|
|
|
phoneType = KABC::PhoneNumber::Fax | KABC::PhoneNumber::Home;
|
|
|
|
phoneType = TDEABC::PhoneNumber::Fax | TDEABC::PhoneNumber::Home;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case eCarPhone:
|
|
|
|
case eCarPhone:
|
|
|
|
phoneType = KABC::PhoneNumber::Car;
|
|
|
|
phoneType = TDEABC::PhoneNumber::Car;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case eTelex:
|
|
|
|
case eTelex:
|
|
|
|
phoneType = KABC::PhoneNumber::Bbs;
|
|
|
|
phoneType = TDEABC::PhoneNumber::Bbs;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case eTTYTTDPhone:
|
|
|
|
case eTTYTTDPhone:
|
|
|
|
phoneType = KABC::PhoneNumber::Pcs;
|
|
|
|
phoneType = TDEABC::PhoneNumber::Pcs;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
WARNINGKPILOT << "Unknown phone mapping " << s.fieldForOtherPhone() << endl;
|
|
|
|
WARNINGKPILOT << "Unknown phone mapping " << s.fieldForOtherPhone() << endl;
|
|
|
|
phoneType = 0;
|
|
|
|
phoneType = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
KABC::PhoneNumber phone = abEntry.phoneNumber(phoneType);
|
|
|
|
TDEABC::PhoneNumber phone = abEntry.phoneNumber(phoneType);
|
|
|
|
phone.setNumber(nr);
|
|
|
|
phone.setNumber(nr);
|
|
|
|
phone.setType(phoneType); // Double-check in case there was no phonenumber of given type
|
|
|
|
phone.setType(phoneType); // Double-check in case there was no phonenumber of given type
|
|
|
|
abEntry.insertPhoneNumber(phone);
|
|
|
|
abEntry.insertPhoneNumber(phone);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KABCSync::setAddress(PilotAddress &toPilotAddr,
|
|
|
|
void KABCSync::setAddress(PilotAddress &toPilotAddr,
|
|
|
|
const KABC::Address & abAddress)
|
|
|
|
const TDEABC::Address & abAddress)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
toPilotAddr.setField(entryAddress, abAddress.street());
|
|
|
|
toPilotAddr.setField(entryAddress, abAddress.street());
|
|
|
|
toPilotAddr.setField(entryCity, abAddress.locality());
|
|
|
|
toPilotAddr.setField(entryCity, abAddress.locality());
|
|
|
@ -494,12 +494,12 @@ void KABCSync::setAddress(PilotAddress &toPilotAddr,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool KABCSync::isArchived(const KABC::Addressee &addr)
|
|
|
|
bool KABCSync::isArchived(const TDEABC::Addressee &addr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return addr.custom(KABCSync::appString, KABCSync::flagString) == TQString::number(SYNCDEL);
|
|
|
|
return addr.custom(KABCSync::appString, KABCSync::flagString) == TQString::number(SYNCDEL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KABCSync::makeArchived(KABC::Addressee &addr)
|
|
|
|
void KABCSync::makeArchived(TDEABC::Addressee &addr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FUNCTIONSETUP;
|
|
|
|
FUNCTIONSETUP;
|
|
|
|
addr.insertCustom(KABCSync::appString, KABCSync::flagString, TQString::number(SYNCDEL));
|
|
|
|
addr.insertCustom(KABCSync::appString, KABCSync::flagString, TQString::number(SYNCDEL));
|
|
|
@ -510,7 +510,7 @@ void KABCSync::makeArchived(KABC::Addressee &addr)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KABCSync::copy(PilotAddress &toPilotAddr,
|
|
|
|
void KABCSync::copy(PilotAddress &toPilotAddr,
|
|
|
|
const KABC::Addressee &fromAbEntry,
|
|
|
|
const TDEABC::Addressee &fromAbEntry,
|
|
|
|
const PilotAddressInfo &appInfo,
|
|
|
|
const PilotAddressInfo &appInfo,
|
|
|
|
const KABCSync::Settings &syncSettings)
|
|
|
|
const KABCSync::Settings &syncSettings)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -541,7 +541,7 @@ void KABCSync::copy(PilotAddress &toPilotAddr,
|
|
|
|
toPilotAddr.setPhoneField(PilotAddressInfo::eOther,
|
|
|
|
toPilotAddr.setPhoneField(PilotAddressInfo::eOther,
|
|
|
|
oth, PilotAddress::Replace);
|
|
|
|
oth, PilotAddress::Replace);
|
|
|
|
|
|
|
|
|
|
|
|
KABC::Address homeAddress = KABCSync::getAddress(fromAbEntry, syncSettings);
|
|
|
|
TDEABC::Address homeAddress = KABCSync::getAddress(fromAbEntry, syncSettings);
|
|
|
|
KABCSync::setAddress(toPilotAddr, homeAddress);
|
|
|
|
KABCSync::setAddress(toPilotAddr, homeAddress);
|
|
|
|
|
|
|
|
|
|
|
|
// Process the additional entries from the Palm(the palm database app block tells us the name of the fields)
|
|
|
|
// Process the additional entries from the Palm(the palm database app block tells us the name of the fields)
|
|
|
@ -567,7 +567,7 @@ void KABCSync::copy(PilotAddress &toPilotAddr,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KABCSync::copy(KABC::Addressee &toAbEntry,
|
|
|
|
void KABCSync::copy(TDEABC::Addressee &toAbEntry,
|
|
|
|
const PilotAddress &fromPiAddr,
|
|
|
|
const PilotAddress &fromPiAddr,
|
|
|
|
const PilotAddressInfo &appInfo,
|
|
|
|
const PilotAddressInfo &appInfo,
|
|
|
|
const KABCSync::Settings &syncSettings)
|
|
|
|
const KABCSync::Settings &syncSettings)
|
|
|
@ -594,18 +594,18 @@ void KABCSync::copy(KABC::Addressee &toAbEntry,
|
|
|
|
// so that they can be set from the Pilot. If we do not do this, then records
|
|
|
|
// so that they can be set from the Pilot. If we do not do this, then records
|
|
|
|
// will be left in kabc when they are removed from the Pilot and we'll look
|
|
|
|
// will be left in kabc when they are removed from the Pilot and we'll look
|
|
|
|
// broken.
|
|
|
|
// broken.
|
|
|
|
KABC::PhoneNumber::List old = toAbEntry.phoneNumbers();
|
|
|
|
TDEABC::PhoneNumber::List old = toAbEntry.phoneNumbers();
|
|
|
|
for (KABC::PhoneNumber::List::Iterator it = old.begin(); it != old.end(); ++it) {
|
|
|
|
for (TDEABC::PhoneNumber::List::Iterator it = old.begin(); it != old.end(); ++it) {
|
|
|
|
KABC::PhoneNumber phone = *it;
|
|
|
|
TDEABC::PhoneNumber phone = *it;
|
|
|
|
toAbEntry.removePhoneNumber(phone);
|
|
|
|
toAbEntry.removePhoneNumber(phone);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// now, get the phone numbers from the Pilot and set them one at a time in kabc
|
|
|
|
// now, get the phone numbers from the Pilot and set them one at a time in kabc
|
|
|
|
KABC::PhoneNumber::List phones = KABCSync::getPhoneNumbers(fromPiAddr);
|
|
|
|
TDEABC::PhoneNumber::List phones = KABCSync::getPhoneNumbers(fromPiAddr);
|
|
|
|
for (KABC::PhoneNumber::List::Iterator it = phones.begin(); it != phones.end(); ++it) {
|
|
|
|
for (TDEABC::PhoneNumber::List::Iterator it = phones.begin(); it != phones.end(); ++it) {
|
|
|
|
KABC::PhoneNumber phone = *it;
|
|
|
|
TDEABC::PhoneNumber phone = *it;
|
|
|
|
// check for fax number if it is one, set the type per the user's direction
|
|
|
|
// check for fax number if it is one, set the type per the user's direction
|
|
|
|
if (phone.type() & KABC::PhoneNumber::Fax)
|
|
|
|
if (phone.type() & TDEABC::PhoneNumber::Fax)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
phone.setType(syncSettings.faxTypeOnPC());
|
|
|
|
phone.setType(syncSettings.faxTypeOnPC());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -622,12 +622,12 @@ void KABCSync::copy(KABC::Addressee &toAbEntry,
|
|
|
|
// so that they can be set from the Pilot. If we do not do this, then records
|
|
|
|
// so that they can be set from the Pilot. If we do not do this, then records
|
|
|
|
// will be left in kabc when they are removed from the Pilot and we'll look
|
|
|
|
// will be left in kabc when they are removed from the Pilot and we'll look
|
|
|
|
// broken.
|
|
|
|
// broken.
|
|
|
|
KABC::Address::List oAddr = toAbEntry.addresses();
|
|
|
|
TDEABC::Address::List oAddr = toAbEntry.addresses();
|
|
|
|
for (KABC::Address::List::Iterator it = oAddr.begin(); it != oAddr.end(); ++it) {
|
|
|
|
for (TDEABC::Address::List::Iterator it = oAddr.begin(); it != oAddr.end(); ++it) {
|
|
|
|
const KABC::Address addr = *it;
|
|
|
|
const TDEABC::Address addr = *it;
|
|
|
|
toAbEntry.removeAddress(addr);
|
|
|
|
toAbEntry.removeAddress(addr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
KABC::Address homeAddress = KABCSync::getAddress(toAbEntry,syncSettings);
|
|
|
|
TDEABC::Address homeAddress = KABCSync::getAddress(toAbEntry,syncSettings);
|
|
|
|
homeAddress.setStreet(fromPiAddr.getField(entryAddress));
|
|
|
|
homeAddress.setStreet(fromPiAddr.getField(entryAddress));
|
|
|
|
homeAddress.setLocality(fromPiAddr.getField(entryCity));
|
|
|
|
homeAddress.setLocality(fromPiAddr.getField(entryCity));
|
|
|
|
homeAddress.setRegion(fromPiAddr.getField(entryState));
|
|
|
|
homeAddress.setRegion(fromPiAddr.getField(entryState));
|
|
|
@ -657,7 +657,7 @@ void KABCSync::copy(KABC::Addressee &toAbEntry,
|
|
|
|
showAddressee(toAbEntry);
|
|
|
|
showAddressee(toAbEntry);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KABCSync::showAddressee(const KABC::Addressee & abAddress)
|
|
|
|
void KABCSync::showAddressee(const TDEABC::Addressee & abAddress)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FUNCTIONSETUP;
|
|
|
|
FUNCTIONSETUP;
|
|
|
|
#ifdef DEBUG
|
|
|
|
#ifdef DEBUG
|
|
|
@ -675,16 +675,16 @@ void KABCSync::showAddressee(const KABC::Addressee & abAddress)
|
|
|
|
DEBUGKPILOT << "\t\tCategory = " << abAddress.categories().first() << endl;
|
|
|
|
DEBUGKPILOT << "\t\tCategory = " << abAddress.categories().first() << endl;
|
|
|
|
DEBUGKPILOT << "\t\tEmail = " << abAddress.emails().join(",") << endl;
|
|
|
|
DEBUGKPILOT << "\t\tEmail = " << abAddress.emails().join(",") << endl;
|
|
|
|
|
|
|
|
|
|
|
|
KABC::PhoneNumber::List phs = abAddress.phoneNumbers();
|
|
|
|
TDEABC::PhoneNumber::List phs = abAddress.phoneNumbers();
|
|
|
|
for (KABC::PhoneNumber::List::Iterator it = phs.begin(); it != phs.end(); ++it) {
|
|
|
|
for (TDEABC::PhoneNumber::List::Iterator it = phs.begin(); it != phs.end(); ++it) {
|
|
|
|
KABC::PhoneNumber phone = *it;
|
|
|
|
TDEABC::PhoneNumber phone = *it;
|
|
|
|
DEBUGKPILOT << "\t\t" << phone.label()
|
|
|
|
DEBUGKPILOT << "\t\t" << phone.label()
|
|
|
|
<< "= " << phone.number() << endl;
|
|
|
|
<< "= " << phone.number() << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KABC::Address::List ads = abAddress.addresses();
|
|
|
|
TDEABC::Address::List ads = abAddress.addresses();
|
|
|
|
for (KABC::Address::List::Iterator it = ads.begin(); it != ads.end(); ++it) {
|
|
|
|
for (TDEABC::Address::List::Iterator it = ads.begin(); it != ads.end(); ++it) {
|
|
|
|
const KABC::Address addr = *it;
|
|
|
|
const TDEABC::Address addr = *it;
|
|
|
|
DEBUGKPILOT << "\t\tAddress = " << addr.street() <<endl;
|
|
|
|
DEBUGKPILOT << "\t\tAddress = " << addr.street() <<endl;
|
|
|
|
DEBUGKPILOT << "\t\tLocality = " << addr.locality() <<endl;
|
|
|
|
DEBUGKPILOT << "\t\tLocality = " << addr.locality() <<endl;
|
|
|
|
DEBUGKPILOT << "\t\tRegion = " << addr.region() <<endl;
|
|
|
|
DEBUGKPILOT << "\t\tRegion = " << addr.region() <<endl;
|
|
|
@ -704,7 +704,7 @@ KABCSync::Settings::Settings() :
|
|
|
|
fCustomMapping(4), // Reserve space for 4 elements, value 0 == CustomField
|
|
|
|
fCustomMapping(4), // Reserve space for 4 elements, value 0 == CustomField
|
|
|
|
fOtherPhone(eOtherPhone),
|
|
|
|
fOtherPhone(eOtherPhone),
|
|
|
|
fPreferHome(true),
|
|
|
|
fPreferHome(true),
|
|
|
|
fFaxTypeOnPC(KABC::PhoneNumber::Fax | KABC::PhoneNumber::Home)
|
|
|
|
fFaxTypeOnPC(TDEABC::PhoneNumber::Fax | TDEABC::PhoneNumber::Home)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|