-rw-r--r-- | kabc/addressbook.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 0838157..20310a0 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -213,34 +213,41 @@ bool AddressBook::ConstIterator::operator!=( const ConstIterator &it ) return ( d->mIt != it.d->mIt ); } AddressBook::AddressBook() { - init(0); + init(0, "contact"); } AddressBook::AddressBook( const QString &config ) { - init(config); + init(config, "contact"); } -void AddressBook::init(const QString &config) +AddressBook::AddressBook( const QString &config, const QString &family ) +{ + init(config, family); + +} + +// the default family is "contact" +void AddressBook::init(const QString &config, const QString &family ) { d = new AddressBookData; if (config != 0) { d->mConfig = new KConfig( config ); // qDebug("AddressBook::init 1 config=%s",config.latin1() ); } else { d->mConfig = 0; // qDebug("AddressBook::init 1 config=0"); } //US d->mErrorHandler = 0; - d->mManager = new KRES::Manager<Resource>( "contact" ); + d->mManager = new KRES::Manager<Resource>( family, false ); d->mManager->readConfig( d->mConfig ); } AddressBook::~AddressBook() { delete d->mConfig; d->mConfig = 0; @@ -538,14 +545,12 @@ QDataStream &KABC::operator>>( QDataStream &s, AddressBook &ab ) return s; } bool AddressBook::addResource( Resource *resource ) { - qDebug("AddressBook::addResource 1"); - if ( !resource->open() ) { kdDebug(5700) << "AddressBook::addResource(): can't add resource" << endl; return false; } resource->setAddressBook( this ); |