Rename KABC namespace

pull/2/head
Timothy Pearson 12 years ago
parent c8376d8f84
commit c6a40717d8

@ -96,14 +96,14 @@ static inline void compile_time_check()
inline int faxTypeOnPC() inline int faxTypeOnPC()
{ {
return KABC::PhoneNumber::Fax | return TDEABC::PhoneNumber::Fax |
( (AbbrowserSettings::pilotFax()==0) ? ( (AbbrowserSettings::pilotFax()==0) ?
KABC::PhoneNumber::Home : TDEABC::PhoneNumber::Home :
KABC::PhoneNumber::Work ); TDEABC::PhoneNumber::Work );
} }
using namespace KABC; using namespace TDEABC;
/********************************************************************* /*********************************************************************
C O N S T R U C T O R C O N S T R U C T O R
@ -1408,7 +1408,7 @@ bool AbbrowserConduit::_equal(const PilotAddress *piAddress, const Addressee &ab
if (flags & eqFlagsAdress) if (flags & eqFlagsAdress)
{ {
KABC::Address address = KABCSync::getAddress(abEntry,fSyncSettings); TDEABC::Address address = KABCSync::getAddress(abEntry,fSyncSettings);
if(!_equal(address.street(), piAddress->getField(entryAddress))) if(!_equal(address.street(), piAddress->getField(entryAddress)))
{ {
DEBUGKPILOT << fname << ": address not equal" << endl; DEBUGKPILOT << fname << ": address not equal" << endl;
@ -1565,7 +1565,7 @@ bool AbbrowserConduit::_buildResolutionTable(ResolutionTable*tab, const Addresse
appendGenPhone(i18n("Other"), KABCSync::getFieldForHHOtherPhone(pcAddr,fSyncSettings), eOther); appendGenPhone(i18n("Other"), KABCSync::getFieldForHHOtherPhone(pcAddr,fSyncSettings), eOther);
appendGenPhone(i18n("Email"), pcAddr.preferredEmail(), eEmail); appendGenPhone(i18n("Email"), pcAddr.preferredEmail(), eEmail);
KABC::Address abAddress = KABCSync::getAddress(pcAddr,fSyncSettings); TDEABC::Address abAddress = KABCSync::getAddress(pcAddr,fSyncSettings);
appendAddr(i18n("Address"), abAddress.street(), entryAddress); appendAddr(i18n("Address"), abAddress.street(), entryAddress);
appendAddr(i18n("City"), abAddress.locality(), entryCity); appendAddr(i18n("City"), abAddress.locality(), entryCity);
appendAddr(i18n("Region"), abAddress.region(), entryState); appendAddr(i18n("Region"), abAddress.region(), entryState);
@ -1672,7 +1672,7 @@ bool AbbrowserConduit::_applyResolutionTable(ResolutionTable*tab, Addressee &pcA
} }
item=tab->next(); item=tab->next();
KABC::Address abAddress = KABCSync::getAddress(pcAddr, fSyncSettings); TDEABC::Address abAddress = KABCSync::getAddress(pcAddr, fSyncSettings);
SETADDRESSFIELD(setStreet, entryAddress); SETADDRESSFIELD(setStreet, entryAddress);
SETADDRESSFIELD(setLocality, entryCity); SETADDRESSFIELD(setLocality, entryCity);
SETADDRESSFIELD(setRegion, entryState); SETADDRESSFIELD(setRegion, entryState);

@ -39,7 +39,7 @@
class ResolutionTable; class ResolutionTable;
namespace KABC namespace TDEABC
{ {
class Addressee; class Addressee;
class Address; class Address;
@ -47,7 +47,7 @@ class PhoneNumber;
class Ticket; class Ticket;
} }
using namespace KABC; using namespace TDEABC;
typedef TQValueList<recordid_t> RecordIDList; typedef TQValueList<recordid_t> RecordIDList;
@ -215,7 +215,7 @@ private:
/** if we add a resource from the addressbook, track it to remove it /** if we add a resource from the addressbook, track it to remove it
* later... * later...
*/ */
KABC::Resource *fBookResource; TDEABC::Resource *fBookResource;
} ; } ;

@ -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)
{ {
} }

@ -43,7 +43,7 @@
#define SYNCMOD 1 #define SYNCMOD 1
#define SYNCDEL 3 #define SYNCDEL 3
namespace KABCSync namespace TDEABCSync
{ {
// This duplicates values from the config settings, // This duplicates values from the config settings,
// and must be kept in sync if new settings are added // and must be kept in sync if new settings are added
@ -141,7 +141,7 @@ namespace KABCSync
/** Return a list of all the phone numbers (max. 8) set in this /** Return a list of all the phone numbers (max. 8) set in this
* handheld entry @p a . Email entries are ignored. * handheld entry @p a . Email entries are ignored.
*/ */
KABC::PhoneNumber::List getPhoneNumbers(const PilotAddress &a); TDEABC::PhoneNumber::List getPhoneNumbers(const PilotAddress &a);
/** Set the phone numbers from @p list in the handheld entry /** Set the phone numbers from @p list in the handheld entry
* @p a (with info block @p info providing the mapping of category * @p a (with info block @p info providing the mapping of category
@ -151,7 +151,7 @@ namespace KABCSync
*/ */
void setPhoneNumbers(const PilotAddressInfo &info, void setPhoneNumbers(const PilotAddressInfo &info,
PilotAddress &a, PilotAddress &a,
const KABC::PhoneNumber::List &list); const TDEABC::PhoneNumber::List &list);
/** Given a list of category names from the KDE side (e.g. attached /** Given a list of category names from the KDE side (e.g. attached
* to a PC-based Addressee) @p categorynames , look for the * to a PC-based Addressee) @p categorynames , look for the
@ -181,7 +181,7 @@ namespace KABCSync
/** Give the addressee @p abEntry the category @p cat (leaving /** Give the addressee @p abEntry the category @p cat (leaving
* existing category assignments intact). * existing category assignments intact).
*/ */
void setCategory(KABC::Addressee &abEntry, const TQString &cat); void setCategory(TDEABC::Addressee &abEntry, const TQString &cat);
/* These are string identifiers used for custom properties in the addressees, /* These are string identifiers used for custom properties in the addressees,
* used to store KPilot-specific settings. * used to store KPilot-specific settings.
@ -203,7 +203,7 @@ namespace KABCSync
*/ */
TQString getFieldForHHCustom( TQString getFieldForHHCustom(
unsigned int index, unsigned int index,
const KABC::Addressee &abEntry, const TDEABC::Addressee &abEntry,
const Settings &settings); const Settings &settings);
/** Set a field of the PC @p abEntry address from the custom HH field. /** Set a field of the PC @p abEntry address from the custom HH field.
@ -214,7 +214,7 @@ namespace KABCSync
*/ */
void setFieldFromHHCustom( void setFieldFromHHCustom(
const unsigned int index, const unsigned int index,
KABC::Addressee &abEntry, TDEABC::Addressee &abEntry,
const TQString &value, const TQString &value,
const Settings &settings); const Settings &settings);
@ -223,7 +223,7 @@ namespace KABCSync
* *
* @note @p mappingForOther should come from AbbrowserSettings::pilotOther() * @note @p mappingForOther should come from AbbrowserSettings::pilotOther()
*/ */
TQString getFieldForHHOtherPhone(const KABC::Addressee &abEntry, const Settings &s); TQString getFieldForHHOtherPhone(const TDEABC::Addressee &abEntry, const Settings &s);
/** The HH has a phone type "other" which may be mapped to any one /** The HH has a phone type "other" which may be mapped to any one
* of several PC side phone numbers. Store the number @p nr in the * of several PC side phone numbers. Store the number @p nr in the
@ -231,7 +231,7 @@ namespace KABCSync
* *
* @note @p mappingForOther should come from AbbrowserSettings::pilotOther() * @note @p mappingForOther should come from AbbrowserSettings::pilotOther()
*/ */
void setFieldFromHHOtherPhone(KABC::Addressee &abEntry, const TQString &nr, const Settings &s); void setFieldFromHHOtherPhone(TDEABC::Addressee &abEntry, const TQString &nr, const Settings &s);
/** Returns the address portion of an addressee. Since the HH can only store /** Returns the address portion of an addressee. Since the HH can only store
* one address, we return the preferred address (if the Addressee @p abEntry * one address, we return the preferred address (if the Addressee @p abEntry
@ -239,24 +239,24 @@ namespace KABCSync
* and if that doesn't exist, the other one and if @em that doesn't exist, * and if that doesn't exist, the other one and if @em that doesn't exist,
* return the preferred home or work address if it exists. * return the preferred home or work address if it exists.
*/ */
KABC::Address getAddress(const KABC::Addressee &abEntry, const Settings &); TDEABC::Address getAddress(const TDEABC::Addressee &abEntry, const Settings &);
/** Set the address fields of the HH record from the @p abAddress . */ /** Set the address fields of the HH record from the @p abAddress . */
void setAddress(PilotAddress &toPilotAddr, const KABC::Address &abAddress); void setAddress(PilotAddress &toPilotAddr, const TDEABC::Address &abAddress);
bool isArchived(const KABC::Addressee &); bool isArchived(const TDEABC::Addressee &);
void makeArchived(KABC::Addressee &); void makeArchived(TDEABC::Addressee &);
void copy(PilotAddress &toPilotAddr, void copy(PilotAddress &toPilotAddr,
const KABC::Addressee &fromAbEntry, const TDEABC::Addressee &fromAbEntry,
const PilotAddressInfo &appInfo, const PilotAddressInfo &appInfo,
const Settings &syncSettings); const Settings &syncSettings);
void copy(KABC::Addressee &toAbEntry, void copy(TDEABC::Addressee &toAbEntry,
const PilotAddress &fromPiAddr, const PilotAddress &fromPiAddr,
const PilotAddressInfo &appInfo, const PilotAddressInfo &appInfo,
const Settings &syncSettings); const Settings &syncSettings);
void showAddressee(const KABC::Addressee &); void showAddressee(const TDEABC::Addressee &);
} }
#endif #endif

@ -29,7 +29,7 @@ libkpilot_la_SOURCES = kpilotlibSettings.kcfgc \
pilotTodoEntry.cc pilotTodoEntry.cc
libkpilot_la_LDFLAGS = $(PISOCK_LDFLAGS) -no-undefined $(all_libraries) $(KDE_EXTRA_RPATH) $(KDE_RPATH) libkpilot_la_LDFLAGS = $(PISOCK_LDFLAGS) -no-undefined $(all_libraries) $(KDE_EXTRA_RPATH) $(KDE_RPATH)
libkpilot_la_LIBADD = $(PISOCK_LIB) $(LIB_TDEUI) $(LIB_KABC) -lkcal $(LIB_QT) $(LIB_TDECORE) -lDCOP $(LIB_KIO) libkpilot_la_LIBADD = $(PISOCK_LIB) $(LIB_TDEUI) $(LIB_TDEABC) -lkcal $(LIB_QT) $(LIB_TDECORE) -lDCOP $(LIB_KIO)
kpilotincludedir = $(includedir)/kpilot kpilotincludedir = $(includedir)/kpilot
kpilotinclude_HEADERS = \ kpilotinclude_HEADERS = \

@ -83,8 +83,8 @@ int main(int argc, char **argv)
return 1; return 1;
} }
KABC::ResourceFile *file = new KABC::ResourceFile( addressfile ); TDEABC::ResourceFile *file = new TDEABC::ResourceFile( addressfile );
KABC::AddressBook book; TDEABC::AddressBook book;
book.addResource( file ); book.addResource( file );
if (!book.load()) if (!book.load())
{ {
@ -104,10 +104,10 @@ int main(int argc, char **argv)
kdDebug() << "# Printing address book." << endl; kdDebug() << "# Printing address book." << endl;
unsigned int count = 1; unsigned int count = 1;
KABC::AddressBook::ConstIterator it = book.begin(); TDEABC::AddressBook::ConstIterator it = book.begin();
while (it != book.end()) while (it != book.end())
{ {
const KABC::Addressee &a = *it; const TDEABC::Addressee &a = *it;
kdDebug() << "# Entry #" << count << endl; kdDebug() << "# Entry #" << count << endl;
kdDebug() << "# " << a.name() << endl; kdDebug() << "# " << a.name() << endl;
kdDebug() << "# " << a.formattedName() << endl; kdDebug() << "# " << a.formattedName() << endl;

Loading…
Cancel
Save