Rename KABC namespace

pull/1/head
Timothy Pearson 12 years ago
parent 3abd4a87cd
commit f17b14a741

@ -48,7 +48,7 @@ K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libkaddrbk_gmx_xxport, GMXXXPort, "libka
#define GMX_FILESELECTION_STRING "*.gmxa|" + i18n( "GMX addressbook file (*.gmxa)" ) #define GMX_FILESELECTION_STRING "*.gmxa|" + i18n( "GMX addressbook file (*.gmxa)" )
GMXXXPort::GMXXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) GMXXXPort::GMXXXPort( TDEABC::AddressBook *ab, TQWidget *parent, const char *name )
: KAB::XXPort( ab, parent, name ) : KAB::XXPort( ab, parent, name )
{ {
createImportAction( i18n( "Import GMX Address Book..." ) ); createImportAction( i18n( "Import GMX Address Book..." ) );
@ -68,9 +68,9 @@ static bool checkDateTime( const TQString &dateStr, TQDateTime &dt )
/* import */ /* import */
KABC::AddresseeList GMXXXPort::importContacts( const TQString& ) const TDEABC::AddresseeList GMXXXPort::importContacts( const TQString& ) const
{ {
KABC::AddresseeList addrList; TDEABC::AddresseeList addrList;
TQString fileName = KFileDialog::getOpenFileName( ":xxport_gmx", TQString fileName = KFileDialog::getOpenFileName( ":xxport_gmx",
GMX_FILESELECTION_STRING, 0 ); GMX_FILESELECTION_STRING, 0 );
@ -96,7 +96,7 @@ KABC::AddresseeList GMXXXPort::importContacts( const TQString& ) const
} }
TQStringList strList; TQStringList strList;
typedef TQMap<TQString, KABC::Addressee *> AddressMap; typedef TQMap<TQString, TDEABC::Addressee *> AddressMap;
AddressMap addrMap; AddressMap addrMap;
// "Address_id,Nickname,Firstname,Lastname,Title,Birthday,Comments,Change_date,Status,Address_link_id,Categories" // "Address_id,Nickname,Firstname,Lastname,Title,Birthday,Comments,Change_date,Status,Address_link_id,Categories"
@ -110,7 +110,7 @@ KABC::AddresseeList GMXXXPort::importContacts( const TQString& ) const
line.append(gmxStream.readLine()); line.append(gmxStream.readLine());
}; };
KABC::Addressee *addr = new KABC::Addressee; TDEABC::Addressee *addr = new TDEABC::Addressee;
addr->setNickName(strList[1]); addr->setNickName(strList[1]);
addr->setGivenName(strList[2]); addr->setGivenName(strList[2]);
addr->setFamilyName(strList[3]); addr->setFamilyName(strList[3]);
@ -150,26 +150,26 @@ KABC::AddresseeList GMXXXPort::importContacts( const TQString& ) const
line.append(gmxStream.readLine()); line.append(gmxStream.readLine());
}; };
KABC::Addressee *addr = addrMap[strList[0]]; TDEABC::Addressee *addr = addrMap[strList[0]];
if (addr) { if (addr) {
for ( TQStringList::Iterator it = strList.begin(); it != strList.end(); ++it ) for ( TQStringList::Iterator it = strList.begin(); it != strList.end(); ++it )
*it = (*it).simplifyWhiteSpace(); *it = (*it).simplifyWhiteSpace();
// strList[1] = Record_id (numbered item, ignore here) // strList[1] = Record_id (numbered item, ignore here)
int id = strList[14].toInt(); // Record_type_id (0=work,1=home,2=other) int id = strList[14].toInt(); // Record_type_id (0=work,1=home,2=other)
int type = (id==0) ? KABC::Address::Work : KABC::Address::Home; int type = (id==0) ? TDEABC::Address::Work : TDEABC::Address::Home;
if (!strList[19].isEmpty() && strList[19].toInt()!=0) if (!strList[19].isEmpty() && strList[19].toInt()!=0)
type |= KABC::Address::Pref; // Preferred address (seems to be bitfield for telephone Prefs) type |= TDEABC::Address::Pref; // Preferred address (seems to be bitfield for telephone Prefs)
KABC::Address adr = addr->address(type); TDEABC::Address adr = addr->address(type);
adr.setStreet(strList[2]); adr.setStreet(strList[2]);
adr.setCountry(strList[3]); adr.setCountry(strList[3]);
adr.setPostalCode(strList[4]); adr.setPostalCode(strList[4]);
adr.setLocality(strList[5]); adr.setLocality(strList[5]);
addr->insertPhoneNumber( KABC::PhoneNumber(strList[6], KABC::PhoneNumber::Home) ); addr->insertPhoneNumber( TDEABC::PhoneNumber(strList[6], TDEABC::PhoneNumber::Home) );
addr->insertPhoneNumber( KABC::PhoneNumber(strList[7], KABC::PhoneNumber::Fax) ); addr->insertPhoneNumber( TDEABC::PhoneNumber(strList[7], TDEABC::PhoneNumber::Fax) );
int celltype = KABC::PhoneNumber::Cell; int celltype = TDEABC::PhoneNumber::Cell;
// strList[9]=Mobile_type // always 0 or -1(default phone). // strList[9]=Mobile_type // always 0 or -1(default phone).
if (strList[9].toInt()) celltype |= KABC::PhoneNumber::Pref; if (strList[9].toInt()) celltype |= TDEABC::PhoneNumber::Pref;
addr->insertPhoneNumber( KABC::PhoneNumber(strList[8], celltype) ); addr->insertPhoneNumber( TDEABC::PhoneNumber(strList[8], celltype) );
addr->insertEmail(strList[10]); addr->insertEmail(strList[10]);
if (!strList[11].isEmpty()) addr->setUrl(strList[11]); if (!strList[11].isEmpty()) addr->setUrl(strList[11]);
if (!strList[12].isEmpty()) addr->setRole(strList[12]); if (!strList[12].isEmpty()) addr->setRole(strList[12]);
@ -192,7 +192,7 @@ KABC::AddresseeList GMXXXPort::importContacts( const TQString& ) const
// now add the addresses to to addrList // now add the addresses to to addrList
for ( AddressMap::Iterator it = addrMap.begin(); it != addrMap.end(); ++it ) { for ( AddressMap::Iterator it = addrMap.begin(); it != addrMap.end(); ++it ) {
KABC::Addressee *addr = it.data(); TDEABC::Addressee *addr = it.data();
addrList.append(*addr); addrList.append(*addr);
delete addr; delete addr;
} }
@ -204,7 +204,7 @@ KABC::AddresseeList GMXXXPort::importContacts( const TQString& ) const
/* export */ /* export */
bool GMXXXPort::exportContacts( const KABC::AddresseeList &list, const TQString& ) bool GMXXXPort::exportContacts( const TDEABC::AddresseeList &list, const TQString& )
{ {
KURL url = KFileDialog::getSaveURL( ":xxport_gmx", GMX_FILESELECTION_STRING ); KURL url = KFileDialog::getSaveURL( ":xxport_gmx", GMX_FILESELECTION_STRING );
if ( url.isEmpty() ) if ( url.isEmpty() )
@ -249,7 +249,7 @@ static const TQString dateString( const TQDateTime &dt )
return d; return d;
} }
void GMXXXPort::doExport( TQFile *fp, const KABC::AddresseeList &list ) void GMXXXPort::doExport( TQFile *fp, const TDEABC::AddresseeList &list )
{ {
if (!fp || !list.count()) if (!fp || !list.count())
return; return;
@ -257,10 +257,10 @@ void GMXXXPort::doExport( TQFile *fp, const KABC::AddresseeList &list )
TQTextStream t( fp ); TQTextStream t( fp );
t.setEncoding( TQTextStream::Latin1 ); t.setEncoding( TQTextStream::Latin1 );
KABC::AddresseeList::ConstIterator it; TDEABC::AddresseeList::ConstIterator it;
typedef TQMap<int, const KABC::Addressee *> AddressMap; typedef TQMap<int, const TDEABC::Addressee *> AddressMap;
AddressMap addrMap; AddressMap addrMap;
const KABC::Addressee *addr; const TDEABC::Addressee *addr;
t << "AB_ADDRESSES:\n"; t << "AB_ADDRESSES:\n";
t << "Address_id,Nickname,Firstname,Lastname,Title,Birthday,Comments," t << "Address_id,Nickname,Firstname,Lastname,Title,Birthday,Comments,"
@ -294,19 +294,19 @@ void GMXXXPort::doExport( TQFile *fp, const KABC::AddresseeList &list )
while ( (addr = addrMap[no]) != NULL ) { while ( (addr = addrMap[no]) != NULL ) {
for (unsigned int record_id=0; record_id<3; record_id++) { for (unsigned int record_id=0; record_id<3; record_id++) {
KABC::Address address; TDEABC::Address address;
KABC::PhoneNumber phone, fax, cell; TDEABC::PhoneNumber phone, fax, cell;
if (record_id == 0) { if (record_id == 0) {
address = addr->address(KABC::Address::Work); address = addr->address(TDEABC::Address::Work);
phone = addr->phoneNumber(KABC::PhoneNumber::Work); phone = addr->phoneNumber(TDEABC::PhoneNumber::Work);
fax = addr->phoneNumber(KABC::PhoneNumber::Fax); fax = addr->phoneNumber(TDEABC::PhoneNumber::Fax);
cell = addr->phoneNumber(KABC::PhoneNumber::Work | KABC::PhoneNumber::Cell); cell = addr->phoneNumber(TDEABC::PhoneNumber::Work | TDEABC::PhoneNumber::Cell);
} else { } else {
address = addr->address(KABC::Address::Home); address = addr->address(TDEABC::Address::Home);
phone = addr->phoneNumber(KABC::PhoneNumber::Home); phone = addr->phoneNumber(TDEABC::PhoneNumber::Home);
cell = addr->phoneNumber(KABC::PhoneNumber::Cell); cell = addr->phoneNumber(TDEABC::PhoneNumber::Cell);
} }
const TQStringList emails = addr->emails(); const TQStringList emails = addr->emails();
@ -322,7 +322,7 @@ void GMXXXPort::doExport( TQFile *fp, const KABC::AddresseeList &list )
<< phone.number() << DELIM // Phone << phone.number() << DELIM // Phone
<< fax.number() << DELIM // Fax << fax.number() << DELIM // Fax
<< cell.number() << DELIM // Mobile << cell.number() << DELIM // Mobile
<< ((cell.type()&KABC::PhoneNumber::Pref)?-1:0) << DELIM // Mobile_type << ((cell.type()&TDEABC::PhoneNumber::Pref)?-1:0) << DELIM // Mobile_type
<< email << DELIM // Email << email << DELIM // Email
<< ((record_id==0)?addr->url().url():TQString()) << DELIM // Homepage << ((record_id==0)?addr->url().url():TQString()) << DELIM // Homepage
<< ((record_id==0)?addr->role():TQString()) << DELIM // Position << ((record_id==0)?addr->role():TQString()) << DELIM // Position

@ -33,16 +33,16 @@ class GMXXXPort : public KAB::XXPort
public: public:
GMXXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); GMXXXPort( TDEABC::AddressBook *ab, TQWidget *parent, const char *name = 0 );
TQString identifier() const { return "gmx"; } TQString identifier() const { return "gmx"; }
public slots: public slots:
bool exportContacts( const KABC::AddresseeList &list, const TQString &data ); bool exportContacts( const TDEABC::AddresseeList &list, const TQString &data );
KABC::AddresseeList importContacts( const TQString &data ) const; TDEABC::AddresseeList importContacts( const TQString &data ) const;
private: private:
void doExport( TQFile *fp, const KABC::AddresseeList &list ); void doExport( TQFile *fp, const TDEABC::AddresseeList &list );
}; };
#endif #endif

@ -40,13 +40,13 @@ class FlagInfo
K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libkaddrbk_geo_xxport, GeoXXPort, "libkaddrbk_geo_xxport" ) K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libkaddrbk_geo_xxport, GeoXXPort, "libkaddrbk_geo_xxport" )
GeoXXPort::GeoXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) GeoXXPort::GeoXXPort( TDEABC::AddressBook *ab, TQWidget *parent, const char *name )
: KAB::XXPort( ab, parent, name ) : KAB::XXPort( ab, parent, name )
{ {
createExportAction( i18n( "Export Geo Data..." ) ); createExportAction( i18n( "Export Geo Data..." ) );
} }
bool GeoXXPort::exportContacts( const KABC::AddresseeList &list, const TQString& ) bool GeoXXPort::exportContacts( const TDEABC::AddresseeList &list, const TQString& )
{ {
TDEConfig config( "kworldclockrc" ); TDEConfig config( "kworldclockrc" );
@ -68,9 +68,9 @@ bool GeoXXPort::exportContacts( const KABC::AddresseeList &list, const TQString&
TQValueList<FlagInfo> flagList; TQValueList<FlagInfo> flagList;
KABC::AddresseeList::ConstIterator addrIt; TDEABC::AddresseeList::ConstIterator addrIt;
for ( addrIt = list.begin(); addrIt != list.end(); ++addrIt ) { for ( addrIt = list.begin(); addrIt != list.end(); ++addrIt ) {
KABC::Geo geo( (*addrIt).geo() ); TDEABC::Geo geo( (*addrIt).geo() );
if ( !geo.isValid() ) if ( !geo.isValid() )
continue; continue;

@ -32,12 +32,12 @@ class GeoXXPort : public KAB::XXPort
public: public:
GeoXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); GeoXXPort( TDEABC::AddressBook *ab, TQWidget *parent, const char *name = 0 );
TQString identifier() const { return "geo"; } TQString identifier() const { return "geo"; }
public slots: public slots:
bool exportContacts( const KABC::AddresseeList &list, const TQString &data ); bool exportContacts( const TDEABC::AddresseeList &list, const TQString &data );
}; };
#endif #endif

@ -9,7 +9,7 @@ kde_module_LTLIBRARIES = libkuickplugin.la
# This is all standard. Remove the LIB_TDEHTML reference if you are not # This is all standard. Remove the LIB_TDEHTML reference if you are not
# using the TDEHTML Part # using the TDEHTML Part
libkuickplugin_la_SOURCES = kuick_plugin.cpp kdirmenu.cpp kmetamenu.cpp kimcontactmenu.cpp libkuickplugin_la_SOURCES = kuick_plugin.cpp kdirmenu.cpp kmetamenu.cpp kimcontactmenu.cpp
libkuickplugin_la_LIBADD = $(LIB_KABC) -ltdeimproxy -lkonq libkuickplugin_la_LIBADD = $(LIB_TDEABC) -ltdeimproxy -lkonq
libkuickplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) libkuickplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
pluginsdir = $(kde_servicesdir) pluginsdir = $(kde_servicesdir)

@ -38,7 +38,7 @@ KIMContactMenu::KIMContactMenu( TQWidget *parent, KIMProxy *proxy )
: TQPopupMenu( parent), mProxy( proxy ) : TQPopupMenu( parent), mProxy( proxy )
{ {
#ifdef KIMCONTACTS_USE_KABC #ifdef KIMCONTACTS_USE_KABC
m_addressBook = KABC::StdAddressBook::self( false ); m_addressBook = TDEABC::StdAddressBook::self( false );
#endif #endif
connect( this, TQT_SIGNAL( activated( int ) ), TQT_SLOT( slotItemActivated( int ) ) ); connect( this, TQT_SIGNAL( activated( int ) ), TQT_SLOT( slotItemActivated( int ) ) );
connect( this, TQT_SIGNAL( aboutToShow( ) ), this, TQT_SLOT( slotAboutToShow( ) ) ); connect( this, TQT_SIGNAL( aboutToShow( ) ), this, TQT_SLOT( slotAboutToShow( ) ) );

@ -27,7 +27,7 @@
#include <tqstringlist.h> #include <tqstringlist.h>
class KIMProxy; class KIMProxy;
namespace KABC { namespace TDEABC {
class AddressBook; class AddressBook;
} }
@ -49,7 +49,7 @@ signals:
protected: protected:
KIMProxy *mProxy; KIMProxy *mProxy;
TQStringList mContacts; TQStringList mContacts;
KABC::AddressBook* m_addressBook; TDEABC::AddressBook* m_addressBook;
}; };
#endif #endif

Loading…
Cancel
Save