-rw-r--r-- | kabc/addressbook.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 0838157..20310a0 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -218,3 +218,3 @@ AddressBook::AddressBook() | |||
218 | { | 218 | { |
219 | init(0); | 219 | init(0, "contact"); |
220 | } | 220 | } |
@@ -223,6 +223,13 @@ AddressBook::AddressBook( const QString &config ) | |||
223 | { | 223 | { |
224 | init(config); | 224 | init(config, "contact"); |
225 | } | 225 | } |
226 | 226 | ||
227 | void AddressBook::init(const QString &config) | 227 | AddressBook::AddressBook( const QString &config, const QString &family ) |
228 | { | ||
229 | init(config, family); | ||
230 | |||
231 | } | ||
232 | |||
233 | // the default family is "contact" | ||
234 | void AddressBook::init(const QString &config, const QString &family ) | ||
228 | { | 235 | { |
@@ -237,5 +244,5 @@ void AddressBook::init(const QString &config) | |||
237 | } | 244 | } |
238 | 245 | ||
239 | //US d->mErrorHandler = 0; | 246 | //US d->mErrorHandler = 0; |
240 | d->mManager = new KRES::Manager<Resource>( "contact" ); | 247 | d->mManager = new KRES::Manager<Resource>( family, false ); |
241 | d->mManager->readConfig( d->mConfig ); | 248 | d->mManager->readConfig( d->mConfig ); |
@@ -253,3 +260,3 @@ bool AddressBook::load() | |||
253 | { | 260 | { |
254 | 261 | ||
255 | 262 | ||
@@ -279,3 +286,3 @@ bool AddressBook::save( Ticket *ticket ) | |||
279 | deleteRemovedAddressees(); | 286 | deleteRemovedAddressees(); |
280 | 287 | ||
281 | return ticket->resource()->save( ticket ); | 288 | return ticket->resource()->save( ticket ); |
@@ -358,3 +365,3 @@ void AddressBook::insertAddressee( const Addressee &a ) | |||
358 | (*it).setRevision( QDateTime::currentDateTime() ); | 365 | (*it).setRevision( QDateTime::currentDateTime() ); |
359 | (*it).setChanged( true ); | 366 | (*it).setChanged( true ); |
360 | } | 367 | } |
@@ -437,3 +444,3 @@ Addressee::List AddressBook::findByEmail( const QString &email ) | |||
437 | for ( it = begin(); it != end(); ++it ) { | 444 | for ( it = begin(); it != end(); ++it ) { |
438 | mailList = (*it).emails(); | 445 | mailList = (*it).emails(); |
439 | for ( QStringList::Iterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { | 446 | for ( QStringList::Iterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { |
@@ -493,5 +500,5 @@ Field::List AddressBook::fields( int category ) | |||
493 | } | 500 | } |
494 | 501 | ||
495 | if ( category == Field::All ) return d->mAllFields; | 502 | if ( category == Field::All ) return d->mAllFields; |
496 | 503 | ||
497 | Field::List result; | 504 | Field::List result; |
@@ -501,3 +508,3 @@ Field::List AddressBook::fields( int category ) | |||
501 | } | 508 | } |
502 | 509 | ||
503 | return result; | 510 | return result; |
@@ -543,4 +550,2 @@ bool AddressBook::addResource( Resource *resource ) | |||
543 | { | 550 | { |
544 | qDebug("AddressBook::addResource 1"); | ||
545 | |||
546 | if ( !resource->open() ) { | 551 | if ( !resource->open() ) { |
@@ -574,3 +579,3 @@ QPtrList<Resource> AddressBook::resources() | |||
574 | // qDebug("AddressBook::resources() 1"); | 579 | // qDebug("AddressBook::resources() 1"); |
575 | 580 | ||
576 | KRES::Manager<Resource>::ActiveIterator it; | 581 | KRES::Manager<Resource>::ActiveIterator it; |