summaryrefslogtreecommitdiffabout
path: root/kabc/addressbook.cpp
Unidiff
Diffstat (limited to 'kabc/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressbook.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index 97bd3ef..0838157 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -222,65 +222,65 @@ AddressBook::AddressBook()
222AddressBook::AddressBook( const QString &config ) 222AddressBook::AddressBook( const QString &config )
223{ 223{
224 init(config); 224 init(config);
225} 225}
226 226
227void AddressBook::init(const QString &config) 227void AddressBook::init(const QString &config)
228{ 228{
229 d = new AddressBookData; 229 d = new AddressBookData;
230 if (config != 0) { 230 if (config != 0) {
231 d->mConfig = new KConfig( config ); 231 d->mConfig = new KConfig( config );
232// qDebug("AddressBook::init 1 config=%s",config.latin1() ); 232// qDebug("AddressBook::init 1 config=%s",config.latin1() );
233 } 233 }
234 else { 234 else {
235 d->mConfig = 0; 235 d->mConfig = 0;
236// qDebug("AddressBook::init 1 config=0"); 236// qDebug("AddressBook::init 1 config=0");
237 } 237 }
238 238
239//US d->mErrorHandler = 0; 239//US d->mErrorHandler = 0;
240 d->mManager = new KRES::Manager<Resource>( "contact" ); 240 d->mManager = new KRES::Manager<Resource>( "contact" );
241 d->mManager->readConfig( d->mConfig ); 241 d->mManager->readConfig( d->mConfig );
242} 242}
243 243
244AddressBook::~AddressBook() 244AddressBook::~AddressBook()
245{ 245{
246 delete d->mConfig; d->mConfig = 0; 246 delete d->mConfig; d->mConfig = 0;
247 delete d->mManager; d->mManager = 0; 247 delete d->mManager; d->mManager = 0;
248//US delete d->mErrorHandler; d->mErrorHandler = 0; 248//US delete d->mErrorHandler; d->mErrorHandler = 0;
249 delete d; d = 0; 249 delete d; d = 0;
250} 250}
251 251
252bool AddressBook::load() 252bool AddressBook::load()
253{ 253{
254 kdDebug(5700) << "AddressBook::load()" << endl; 254
255 255
256 clear(); 256 clear();
257 257
258 KRES::Manager<Resource>::ActiveIterator it; 258 KRES::Manager<Resource>::ActiveIterator it;
259 bool ok = true; 259 bool ok = true;
260 for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) 260 for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it )
261 if ( !(*it)->load() ) { 261 if ( !(*it)->load() ) {
262 error( i18n("Unable to load resource '%1'").arg( (*it)->resourceName() ) ); 262 error( i18n("Unable to load resource '%1'").arg( (*it)->resourceName() ) );
263 ok = false; 263 ok = false;
264 } 264 }
265 265
266 // mark all addressees as unchanged 266 // mark all addressees as unchanged
267 Addressee::List::Iterator addrIt; 267 Addressee::List::Iterator addrIt;
268 for ( addrIt = d->mAddressees.begin(); addrIt != d->mAddressees.end(); ++addrIt ) 268 for ( addrIt = d->mAddressees.begin(); addrIt != d->mAddressees.end(); ++addrIt )
269 (*addrIt).setChanged( false ); 269 (*addrIt).setChanged( false );
270 270
271 return ok; 271 return ok;
272} 272}
273 273
274bool AddressBook::save( Ticket *ticket ) 274bool AddressBook::save( Ticket *ticket )
275{ 275{
276 kdDebug(5700) << "AddressBook::save()"<< endl; 276 kdDebug(5700) << "AddressBook::save()"<< endl;
277 277
278 if ( ticket->resource() ) { 278 if ( ticket->resource() ) {
279 deleteRemovedAddressees(); 279 deleteRemovedAddressees();
280 280
281 return ticket->resource()->save( ticket ); 281 return ticket->resource()->save( ticket );
282 } 282 }
283 283
284 return false; 284 return false;
285} 285}
286 286