summaryrefslogtreecommitdiffabout
path: root/kabc
Unidiff
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressbook.cpp24
-rw-r--r--kabc/addressbook.h2
2 files changed, 16 insertions, 10 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index f3744bc..e04f4b1 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -188,408 +188,414 @@ const Addressee* AddressBook::ConstIterator::operator->() const
188} 188}
189 189
190AddressBook::ConstIterator &AddressBook::ConstIterator::operator++() 190AddressBook::ConstIterator &AddressBook::ConstIterator::operator++()
191{ 191{
192 (d->mIt)++; 192 (d->mIt)++;
193 return *this; 193 return *this;
194} 194}
195 195
196AddressBook::ConstIterator &AddressBook::ConstIterator::operator++(int) 196AddressBook::ConstIterator &AddressBook::ConstIterator::operator++(int)
197{ 197{
198 (d->mIt)++; 198 (d->mIt)++;
199 return *this; 199 return *this;
200} 200}
201 201
202AddressBook::ConstIterator &AddressBook::ConstIterator::operator--() 202AddressBook::ConstIterator &AddressBook::ConstIterator::operator--()
203{ 203{
204 (d->mIt)--; 204 (d->mIt)--;
205 return *this; 205 return *this;
206} 206}
207 207
208AddressBook::ConstIterator &AddressBook::ConstIterator::operator--(int) 208AddressBook::ConstIterator &AddressBook::ConstIterator::operator--(int)
209{ 209{
210 (d->mIt)--; 210 (d->mIt)--;
211 return *this; 211 return *this;
212} 212}
213 213
214bool AddressBook::ConstIterator::operator==( const ConstIterator &it ) 214bool AddressBook::ConstIterator::operator==( const ConstIterator &it )
215{ 215{
216 return ( d->mIt == it.d->mIt ); 216 return ( d->mIt == it.d->mIt );
217} 217}
218 218
219bool AddressBook::ConstIterator::operator!=( const ConstIterator &it ) 219bool AddressBook::ConstIterator::operator!=( const ConstIterator &it )
220{ 220{
221 return ( d->mIt != it.d->mIt ); 221 return ( d->mIt != it.d->mIt );
222} 222}
223 223
224 224
225AddressBook::AddressBook() 225AddressBook::AddressBook()
226{ 226{
227 init(0, "contact"); 227 init(0, "contact");
228} 228}
229 229
230AddressBook::AddressBook( const QString &config ) 230AddressBook::AddressBook( const QString &config )
231{ 231{
232 init(config, "contact"); 232 init(config, "contact");
233} 233}
234 234
235AddressBook::AddressBook( const QString &config, const QString &family ) 235AddressBook::AddressBook( const QString &config, const QString &family )
236{ 236{
237 init(config, family); 237 init(config, family);
238 238
239} 239}
240 240
241// the default family is "contact" 241// the default family is "contact"
242void AddressBook::init(const QString &config, const QString &family ) 242void AddressBook::init(const QString &config, const QString &family )
243{ 243{
244 blockLSEchange = false; 244 blockLSEchange = false;
245 d = new AddressBookData; 245 d = new AddressBookData;
246 QString fami = family; 246 QString fami = family;
247 if (config != 0) { 247 if (config != 0) {
248 if ( family == "syncContact" ) { 248 if ( family == "syncContact" ) {
249 qDebug("creating sync config "); 249 qDebug("creating sync config ");
250 fami = "contact"; 250 fami = "contact";
251 KConfig* con = new KConfig( locateLocal("config", "syncContactrc") ); 251 KConfig* con = new KConfig( locateLocal("config", "syncContactrc") );
252 con->setGroup( "General" ); 252 con->setGroup( "General" );
253 con->writeEntry( "ResourceKeys", QString("sync") ); 253 con->writeEntry( "ResourceKeys", QString("sync") );
254 con->writeEntry( "Standard", QString("sync") ); 254 con->writeEntry( "Standard", QString("sync") );
255 con->setGroup( "Resource_sync" ); 255 con->setGroup( "Resource_sync" );
256 con->writeEntry( "FileName", config ); 256 con->writeEntry( "FileName", config );
257 con->writeEntry( "FileFormat", QString("vcard") ); 257 con->writeEntry( "FileFormat", QString("vcard") );
258 con->writeEntry( "ResourceIdentifier", QString("sync") ); 258 con->writeEntry( "ResourceIdentifier", QString("sync") );
259 con->writeEntry( "ResourceName", QString("sync_res") ); 259 con->writeEntry( "ResourceName", QString("sync_res") );
260 if ( config.right(4) == ".xml" ) 260 if ( config.right(4) == ".xml" )
261 con->writeEntry( "ResourceType", QString("qtopia") ); 261 con->writeEntry( "ResourceType", QString("qtopia") );
262 else if ( config == "sharp" ) { 262 else if ( config == "sharp" ) {
263 con->writeEntry( "ResourceType", QString("sharp") ); 263 con->writeEntry( "ResourceType", QString("sharp") );
264 } else { 264 } else {
265 con->writeEntry( "ResourceType", QString("file") ); 265 con->writeEntry( "ResourceType", QString("file") );
266 } 266 }
267 //con->sync(); 267 //con->sync();
268 d->mConfig = con; 268 d->mConfig = con;
269 } 269 }
270 else 270 else
271 d->mConfig = new KConfig( locateLocal("config", config) ); 271 d->mConfig = new KConfig( locateLocal("config", config) );
272// qDebug("AddressBook::init 1 config=%s",config.latin1() ); 272// qDebug("AddressBook::init 1 config=%s",config.latin1() );
273 } 273 }
274 else { 274 else {
275 d->mConfig = 0; 275 d->mConfig = 0;
276// qDebug("AddressBook::init 1 config=0"); 276// qDebug("AddressBook::init 1 config=0");
277 } 277 }
278 278
279//US d->mErrorHandler = 0; 279//US d->mErrorHandler = 0;
280 d->mManager = new KRES::Manager<Resource>( fami ); 280 d->mManager = new KRES::Manager<Resource>( fami );
281 d->mManager->readConfig( d->mConfig ); 281 d->mManager->readConfig( d->mConfig );
282 if ( family == "syncContact" ) { 282 if ( family == "syncContact" ) {
283 KRES::Manager<Resource> *manager = d->mManager; 283 KRES::Manager<Resource> *manager = d->mManager;
284 KRES::Manager<Resource>::ActiveIterator it; 284 KRES::Manager<Resource>::ActiveIterator it;
285 for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { 285 for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) {
286 (*it)->setAddressBook( this ); 286 (*it)->setAddressBook( this );
287 if ( !(*it)->open() ) 287 if ( !(*it)->open() )
288 error( QString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) ); 288 error( QString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) );
289 } 289 }
290 Resource *res = standardResource(); 290 Resource *res = standardResource();
291 if ( !res ) { 291 if ( !res ) {
292 qDebug("ERROR: no standard resource"); 292 qDebug("ERROR: no standard resource");
293 res = manager->createResource( "file" ); 293 res = manager->createResource( "file" );
294 if ( res ) 294 if ( res )
295 { 295 {
296 addResource( res ); 296 addResource( res );
297 } 297 }
298 else 298 else
299 qDebug(" No resource available!!!"); 299 qDebug(" No resource available!!!");
300 } 300 }
301 setStandardResource( res ); 301 setStandardResource( res );
302 manager->writeConfig(); 302 manager->writeConfig();
303 } 303 }
304 addCustomField( i18n( "Department" ), KABC::Field::Organization, 304 addCustomField( i18n( "Department" ), KABC::Field::Organization,
305 "X-Department", "KADDRESSBOOK" ); 305 "X-Department", "KADDRESSBOOK" );
306 addCustomField( i18n( "Profession" ), KABC::Field::Organization, 306 addCustomField( i18n( "Profession" ), KABC::Field::Organization,
307 "X-Profession", "KADDRESSBOOK" ); 307 "X-Profession", "KADDRESSBOOK" );
308 addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 308 addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
309 "X-AssistantsName", "KADDRESSBOOK" ); 309 "X-AssistantsName", "KADDRESSBOOK" );
310 addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 310 addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
311 "X-ManagersName", "KADDRESSBOOK" ); 311 "X-ManagersName", "KADDRESSBOOK" );
312 addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 312 addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
313 "X-SpousesName", "KADDRESSBOOK" ); 313 "X-SpousesName", "KADDRESSBOOK" );
314 addCustomField( i18n( "Office" ), KABC::Field::Personal, 314 addCustomField( i18n( "Office" ), KABC::Field::Personal,
315 "X-Office", "KADDRESSBOOK" ); 315 "X-Office", "KADDRESSBOOK" );
316 addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 316 addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
317 "X-IMAddress", "KADDRESSBOOK" ); 317 "X-IMAddress", "KADDRESSBOOK" );
318 addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 318 addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
319 "X-Anniversary", "KADDRESSBOOK" ); 319 "X-Anniversary", "KADDRESSBOOK" );
320 320
321 //US added this field to become compatible with Opie/qtopia addressbook 321 //US added this field to become compatible with Opie/qtopia addressbook
322 // values can be "female" or "male" or "". An empty field represents undefined. 322 // values can be "female" or "male" or "". An empty field represents undefined.
323 addCustomField( i18n( "Gender" ), KABC::Field::Personal, 323 addCustomField( i18n( "Gender" ), KABC::Field::Personal,
324 "X-Gender", "KADDRESSBOOK" ); 324 "X-Gender", "KADDRESSBOOK" );
325 addCustomField( i18n( "Children" ), KABC::Field::Personal, 325 addCustomField( i18n( "Children" ), KABC::Field::Personal,
326 "X-Children", "KADDRESSBOOK" ); 326 "X-Children", "KADDRESSBOOK" );
327 addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 327 addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
328 "X-FreeBusyUrl", "KADDRESSBOOK" ); 328 "X-FreeBusyUrl", "KADDRESSBOOK" );
329 addCustomField( i18n( "ExternalID" ), KABC::Field::Personal, 329 addCustomField( i18n( "ExternalID" ), KABC::Field::Personal,
330 "X-ExternalID", "KADDRESSBOOK" ); 330 "X-ExternalID", "KADDRESSBOOK" );
331} 331}
332 332
333AddressBook::~AddressBook() 333AddressBook::~AddressBook()
334{ 334{
335 delete d->mConfig; d->mConfig = 0; 335 delete d->mConfig; d->mConfig = 0;
336 delete d->mManager; d->mManager = 0; 336 delete d->mManager; d->mManager = 0;
337//US delete d->mErrorHandler; d->mErrorHandler = 0; 337//US delete d->mErrorHandler; d->mErrorHandler = 0;
338 delete d; d = 0; 338 delete d; d = 0;
339} 339}
340 340
341bool AddressBook::load() 341bool AddressBook::load()
342{ 342{
343 343
344 clear(); 344 clear();
345 KRES::Manager<Resource>::ActiveIterator it; 345 KRES::Manager<Resource>::ActiveIterator it;
346 bool ok = true; 346 bool ok = true;
347 for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) 347 for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it )
348 if ( !(*it)->load() ) { 348 if ( !(*it)->load() ) {
349 qDebug( i18n("Unable to load resource '%1'").arg( (*it)->resourceName() ) ); 349 qDebug( i18n("Unable to load resource '%1'").arg( (*it)->resourceName() ) );
350 ok = false; 350 ok = false;
351 } else { 351 } else {
352 qDebug( i18n("Resource loaded: '%1'").arg( (*it)->resourceName() ) ); 352 qDebug( i18n("Resource loaded: '%1'").arg( (*it)->resourceName() ) );
353 } 353 }
354 // mark all addressees as unchanged 354 // mark all addressees as unchanged
355 Addressee::List::Iterator addrIt; 355 Addressee::List::Iterator addrIt;
356 for ( addrIt = d->mAddressees.begin(); addrIt != d->mAddressees.end(); ++addrIt ) { 356 for ( addrIt = d->mAddressees.begin(); addrIt != d->mAddressees.end(); ++addrIt ) {
357 (*addrIt).setChanged( false ); 357 (*addrIt).setChanged( false );
358 QString id = (*addrIt).custom( "KADDRESSBOOK", "X-ExternalID" ); 358 QString id = (*addrIt).custom( "KADDRESSBOOK", "X-ExternalID" );
359 if ( !id.isEmpty() ) { 359 if ( !id.isEmpty() ) {
360 //qDebug("setId aa %s ", id.latin1()); 360 //qDebug("setId aa %s ", id.latin1());
361 (*addrIt).setIDStr(id ); 361 (*addrIt).setIDStr(id );
362 } 362 }
363 } 363 }
364 blockLSEchange = true; 364 blockLSEchange = true;
365 return ok; 365 return ok;
366} 366}
367 367
368bool AddressBook::save( Ticket *ticket ) 368bool AddressBook::save( Ticket *ticket )
369{ 369{
370 kdDebug(5700) << "AddressBook::save()"<< endl; 370 kdDebug(5700) << "AddressBook::save()"<< endl;
371 371
372 if ( ticket->resource() ) { 372 if ( ticket->resource() ) {
373 deleteRemovedAddressees(); 373 deleteRemovedAddressees();
374 return ticket->resource()->save( ticket ); 374 return ticket->resource()->save( ticket );
375 } 375 }
376 376
377 return false; 377 return false;
378} 378}
379// exports all Addressees, which are syncable 379// exports all Addressees, which are syncable
380void AddressBook::export2File( QString fileName ) 380void AddressBook::export2File( QString fileName, QString resourceName )
381{ 381{
382 382
383 QFile outFile( fileName ); 383 QFile outFile( fileName );
384 if ( !outFile.open( IO_WriteOnly ) ) { 384 if ( !outFile.open( IO_WriteOnly ) ) {
385 QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" ); 385 QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" );
386 KMessageBox::error( 0, text.arg( fileName ) ); 386 KMessageBox::error( 0, text.arg( fileName ) );
387 return ; 387 return ;
388 } 388 }
389 QTextStream t( &outFile ); 389 QTextStream t( &outFile );
390 t.setEncoding( QTextStream::UnicodeUTF8 ); 390 t.setEncoding( QTextStream::UnicodeUTF8 );
391 Iterator it; 391 Iterator it;
392 KABC::VCardConverter::Version version; 392 KABC::VCardConverter::Version version;
393 version = KABC::VCardConverter::v3_0; 393 version = KABC::VCardConverter::v3_0;
394 for ( it = begin(); it != end(); ++it ) { 394 for ( it = begin(); it != end(); ++it ) {
395 if ( (*it).resource() && (*it).resource()->includeInSync() ) { 395 if ( (*it).resource() ) {
396 if ( !(*it).IDStr().isEmpty() ) { 396 bool include = (*it).resource()->includeInSync();
397 (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() ); 397 if ( !resourceName.isEmpty() )
398 include = (resourceName == (*it).resource()->name() );
399 if ( include ) {
400 qDebug(QString ("Exporting resource %1 to file %2").arg( (*it).resource()->name() ).arg( fileName ) );
401 if ( !(*it).IDStr().isEmpty() ) {
402 (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() );
403 }
404 KABC::VCardConverter converter;
405 QString vcard;
406 //Resource *resource() const;
407 converter.addresseeToVCard( *it, vcard, version );
408 t << vcard << "\r\n";
398 } 409 }
399 KABC::VCardConverter converter;
400 QString vcard;
401 //Resource *resource() const;
402 converter.addresseeToVCard( *it, vcard, version );
403 t << vcard << "\r\n";
404 } 410 }
405 } 411 }
406 t << "\r\n\r\n"; 412 t << "\r\n\r\n";
407 outFile.close(); 413 outFile.close();
408} 414}
409// if QStringList uids is empty, all are exported 415// if QStringList uids is empty, all are exported
410bool AddressBook::export2PhoneFormat( QStringList uids ,QString fileName ) 416bool AddressBook::export2PhoneFormat( QStringList uids ,QString fileName )
411{ 417{
412 KABC::VCardConverter converter; 418 KABC::VCardConverter converter;
413 QString datastream; 419 QString datastream;
414 Iterator it; 420 Iterator it;
415 bool all = uids.isEmpty(); 421 bool all = uids.isEmpty();
416 for ( it = begin(); it != end(); ++it ) { 422 for ( it = begin(); it != end(); ++it ) {
417 // for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 423 // for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
418 if ( ! all ) { 424 if ( ! all ) {
419 if ( ! ( uids.contains((*it).uid() ) )) 425 if ( ! ( uids.contains((*it).uid() ) ))
420 continue; 426 continue;
421 } 427 }
422 KABC::Addressee a = ( *it ); 428 KABC::Addressee a = ( *it );
423 if ( a.isEmpty() ) 429 if ( a.isEmpty() )
424 continue; 430 continue;
425 if ( all && a.resource() && !a.resource()->includeInSync() ) 431 if ( all && a.resource() && !a.resource()->includeInSync() )
426 continue; 432 continue;
427 a.simplifyEmails(); 433 a.simplifyEmails();
428 a.simplifyPhoneNumbers(); 434 a.simplifyPhoneNumbers();
429 a.simplifyPhoneNumberTypes(); 435 a.simplifyPhoneNumberTypes();
430 a.simplifyAddresses(); 436 a.simplifyAddresses();
431 437
432 QString vcard; 438 QString vcard;
433 QString vcardnew; 439 QString vcardnew;
434 converter.addresseeToVCard( a, vcard ); 440 converter.addresseeToVCard( a, vcard );
435 int start = 0; 441 int start = 0;
436 int next; 442 int next;
437 while ( (next = vcard.find("TYPE=", start) )>= 0 ) { 443 while ( (next = vcard.find("TYPE=", start) )>= 0 ) {
438 int semi = vcard.find(";", next); 444 int semi = vcard.find(";", next);
439 int dopp = vcard.find(":", next); 445 int dopp = vcard.find(":", next);
440 int sep; 446 int sep;
441 if ( semi < dopp && semi >= 0 ) 447 if ( semi < dopp && semi >= 0 )
442 sep = semi ; 448 sep = semi ;
443 else 449 else
444 sep = dopp; 450 sep = dopp;
445 vcardnew +=vcard.mid( start, next - start); 451 vcardnew +=vcard.mid( start, next - start);
446 vcardnew +=vcard.mid( next+5,sep -next -5 ).upper(); 452 vcardnew +=vcard.mid( next+5,sep -next -5 ).upper();
447 start = sep; 453 start = sep;
448 } 454 }
449 vcardnew += vcard.mid( start,vcard.length() ); 455 vcardnew += vcard.mid( start,vcard.length() );
450 vcard = ""; 456 vcard = "";
451 start = 0; 457 start = 0;
452 while ( (next = vcardnew.find("ADR", start) )>= 0 ) { 458 while ( (next = vcardnew.find("ADR", start) )>= 0 ) {
453 int sep = vcardnew.find(":", next); 459 int sep = vcardnew.find(":", next);
454 vcard +=vcardnew.mid( start, next - start+3); 460 vcard +=vcardnew.mid( start, next - start+3);
455 start = sep; 461 start = sep;
456 } 462 }
457 vcard += vcardnew.mid( start,vcardnew.length() ); 463 vcard += vcardnew.mid( start,vcardnew.length() );
458 vcard.replace ( QRegExp(";;;") , "" ); 464 vcard.replace ( QRegExp(";;;") , "" );
459 vcard.replace ( QRegExp(";;") , "" ); 465 vcard.replace ( QRegExp(";;") , "" );
460 datastream += vcard; 466 datastream += vcard;
461 467
462 } 468 }
463 469
464 QFile outFile(fileName); 470 QFile outFile(fileName);
465 if ( outFile.open(IO_WriteOnly) ) { 471 if ( outFile.open(IO_WriteOnly) ) {
466 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 472 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
467 QTextStream t( &outFile ); // use a text stream 473 QTextStream t( &outFile ); // use a text stream
468 t.setEncoding( QTextStream::UnicodeUTF8 ); 474 t.setEncoding( QTextStream::UnicodeUTF8 );
469 t <<datastream; 475 t <<datastream;
470 t << "\r\n\r\n"; 476 t << "\r\n\r\n";
471 outFile.close(); 477 outFile.close();
472 478
473 } else { 479 } else {
474 qDebug("Error open temp file "); 480 qDebug("Error open temp file ");
475 return false; 481 return false;
476 } 482 }
477 return true; 483 return true;
478 484
479} 485}
480int AddressBook::importFromFile( QString fileName, bool replaceLabel, bool removeOld ) 486int AddressBook::importFromFile( QString fileName, bool replaceLabel, bool removeOld )
481{ 487{
482 488
483 if ( removeOld ) 489 if ( removeOld )
484 setUntagged( true ); 490 setUntagged( true );
485 KABC::Addressee::List list; 491 KABC::Addressee::List list;
486 QFile file( fileName ); 492 QFile file( fileName );
487 file.open( IO_ReadOnly ); 493 file.open( IO_ReadOnly );
488 QByteArray rawData = file.readAll(); 494 QByteArray rawData = file.readAll();
489 file.close(); 495 file.close();
490 QString data; 496 QString data;
491 if ( replaceLabel ) { 497 if ( replaceLabel ) {
492 data = QString::fromLatin1( rawData.data(), rawData.size() + 1 ); 498 data = QString::fromLatin1( rawData.data(), rawData.size() + 1 );
493 data.replace ( QRegExp("LABEL") , "ADR" ); 499 data.replace ( QRegExp("LABEL") , "ADR" );
494 data.replace ( QRegExp("CHARSET=ISO-8859-1") , "" ); 500 data.replace ( QRegExp("CHARSET=ISO-8859-1") , "" );
495 } else 501 } else
496 data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); 502 data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
497 KABC::VCardTool tool; 503 KABC::VCardTool tool;
498 list = tool.parseVCards( data ); 504 list = tool.parseVCards( data );
499 KABC::Addressee::List::Iterator it; 505 KABC::Addressee::List::Iterator it;
500 for ( it = list.begin(); it != list.end(); ++it ) { 506 for ( it = list.begin(); it != list.end(); ++it ) {
501 QString id = (*it).custom( "KADDRESSBOOK", "X-ExternalID" ); 507 QString id = (*it).custom( "KADDRESSBOOK", "X-ExternalID" );
502 if ( !id.isEmpty() ) 508 if ( !id.isEmpty() )
503 (*it).setIDStr(id ); 509 (*it).setIDStr(id );
504 (*it).setResource( 0 ); 510 (*it).setResource( 0 );
505 if ( replaceLabel ) 511 if ( replaceLabel )
506 (*it).removeVoice(); 512 (*it).removeVoice();
507 if ( removeOld ) 513 if ( removeOld )
508 (*it).setTagged( true ); 514 (*it).setTagged( true );
509 insertAddressee( (*it), false, true ); 515 insertAddressee( (*it), false, true );
510 } 516 }
511 if ( removeOld ) 517 if ( removeOld )
512 removeUntagged(); 518 removeUntagged();
513 return list.count(); 519 return list.count();
514} 520}
515void AddressBook::setUntagged(bool setNonSyncTagged) // = false) 521void AddressBook::setUntagged(bool setNonSyncTagged) // = false)
516{ 522{
517 Iterator ait; 523 Iterator ait;
518 for ( ait = begin(); ait != end(); ++ait ) { 524 for ( ait = begin(); ait != end(); ++ait ) {
519 if ( setNonSyncTagged ) { 525 if ( setNonSyncTagged ) {
520 if ( (*ait).resource() && ! (*ait).resource()->includeInSync() ) { 526 if ( (*ait).resource() && ! (*ait).resource()->includeInSync() ) {
521 (*ait).setTagged( true ); 527 (*ait).setTagged( true );
522 } else 528 } else
523 (*ait).setTagged( false ); 529 (*ait).setTagged( false );
524 } else 530 } else
525 (*ait).setTagged( false ); 531 (*ait).setTagged( false );
526 } 532 }
527} 533}
528void AddressBook::removeUntagged() 534void AddressBook::removeUntagged()
529{ 535{
530 Iterator ait; 536 Iterator ait;
531 bool todelete = false; 537 bool todelete = false;
532 Iterator todel; 538 Iterator todel;
533 for ( ait = begin(); ait != end(); ++ait ) { 539 for ( ait = begin(); ait != end(); ++ait ) {
534 if ( todelete ) 540 if ( todelete )
535 removeAddressee( todel ); 541 removeAddressee( todel );
536 if (!(*ait).tagged()) { 542 if (!(*ait).tagged()) {
537 todelete = true; 543 todelete = true;
538 todel = ait; 544 todel = ait;
539 } else 545 } else
540 todelete = false; 546 todelete = false;
541 } 547 }
542 if ( todelete ) 548 if ( todelete )
543 removeAddressee( todel ); 549 removeAddressee( todel );
544 deleteRemovedAddressees(); 550 deleteRemovedAddressees();
545} 551}
546void AddressBook::smplifyAddressees() 552void AddressBook::smplifyAddressees()
547{ 553{
548 Iterator ait; 554 Iterator ait;
549 for ( ait = begin(); ait != end(); ++ait ) { 555 for ( ait = begin(); ait != end(); ++ait ) {
550 (*ait).simplifyEmails(); 556 (*ait).simplifyEmails();
551 (*ait).simplifyPhoneNumbers(); 557 (*ait).simplifyPhoneNumbers();
552 (*ait).simplifyPhoneNumberTypes(); 558 (*ait).simplifyPhoneNumberTypes();
553 (*ait).simplifyAddresses(); 559 (*ait).simplifyAddresses();
554 } 560 }
555} 561}
556void AddressBook::removeSyncInfo( QString syncProfile) 562void AddressBook::removeSyncInfo( QString syncProfile)
557{ 563{
558 Iterator ait; 564 Iterator ait;
559 for ( ait = begin(); ait != end(); ++ait ) { 565 for ( ait = begin(); ait != end(); ++ait ) {
560 (*ait).removeID( syncProfile ); 566 (*ait).removeID( syncProfile );
561 } 567 }
562 if ( syncProfile.isEmpty() ) { 568 if ( syncProfile.isEmpty() ) {
563 Iterator it = begin(); 569 Iterator it = begin();
564 Iterator it2 ; 570 Iterator it2 ;
565 while ( it != end() ) { 571 while ( it != end() ) {
566 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) { 572 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) {
567 it2 = it; 573 it2 = it;
568 //qDebug("removing %s ",(*it).uid().latin1() ); 574 //qDebug("removing %s ",(*it).uid().latin1() );
569 ++it; 575 ++it;
570 removeAddressee( it2 ); 576 removeAddressee( it2 );
571 } else { 577 } else {
572 //qDebug("skipping %s ",(*it).uid().latin1() ); 578 //qDebug("skipping %s ",(*it).uid().latin1() );
573 ++it; 579 ++it;
574 } 580 }
575 } 581 }
576 } else { 582 } else {
577 Addressee lse; 583 Addressee lse;
578 lse = findByUid( "last-syncAddressee-"+ syncProfile ); 584 lse = findByUid( "last-syncAddressee-"+ syncProfile );
579 if ( ! lse.isEmpty() ) 585 if ( ! lse.isEmpty() )
580 removeAddressee( lse ); 586 removeAddressee( lse );
581 } 587 }
582 588
583} 589}
584void AddressBook::preparePhoneSync( QString currentSyncDevice, bool isPreSync ) 590void AddressBook::preparePhoneSync( QString currentSyncDevice, bool isPreSync )
585{ 591{
586 Iterator ait; 592 Iterator ait;
587 for ( ait = begin(); ait != end(); ++ait ) { 593 for ( ait = begin(); ait != end(); ++ait ) {
588 QString id = (*ait).IDStr(); 594 QString id = (*ait).IDStr();
589 (*ait).setIDStr( ":"); 595 (*ait).setIDStr( ":");
590 (*ait).setExternalUID( id ); 596 (*ait).setExternalUID( id );
591 (*ait).setOriginalExternalUID( id ); 597 (*ait).setOriginalExternalUID( id );
592 if ( isPreSync ) 598 if ( isPreSync )
593 (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); 599 (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL );
594 else { 600 else {
595 (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); 601 (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
diff --git a/kabc/addressbook.h b/kabc/addressbook.h
index 18c03b5..4a0d0a3 100644
--- a/kabc/addressbook.h
+++ b/kabc/addressbook.h
@@ -1,341 +1,341 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#ifndef KABC_ADDRESSBOOK_H 28#ifndef KABC_ADDRESSBOOK_H
29#define KABC_ADDRESSBOOK_H 29#define KABC_ADDRESSBOOK_H
30 30
31#include <qobject.h> 31#include <qobject.h>
32 32
33#include <kresources/manager.h> 33#include <kresources/manager.h>
34#include <qptrlist.h> 34#include <qptrlist.h>
35 35
36#include "addressee.h" 36#include "addressee.h"
37#include "field.h" 37#include "field.h"
38 38
39namespace KABC { 39namespace KABC {
40 40
41class ErrorHandler; 41class ErrorHandler;
42class Resource; 42class Resource;
43class Ticket; 43class Ticket;
44 44
45/** 45/**
46 @short Address Book 46 @short Address Book
47 47
48 This class provides access to a collection of address book entries. 48 This class provides access to a collection of address book entries.
49*/ 49*/
50class AddressBook : public QObject 50class AddressBook : public QObject
51{ 51{
52 Q_OBJECT 52 Q_OBJECT
53 53
54 friend QDataStream &operator<<( QDataStream &, const AddressBook & ); 54 friend QDataStream &operator<<( QDataStream &, const AddressBook & );
55 friend QDataStream &operator>>( QDataStream &, AddressBook & ); 55 friend QDataStream &operator>>( QDataStream &, AddressBook & );
56 friend class StdAddressBook; 56 friend class StdAddressBook;
57 57
58 public: 58 public:
59 /** 59 /**
60 @short Address Book Iterator 60 @short Address Book Iterator
61 61
62 This class provides an iterator for address book entries. 62 This class provides an iterator for address book entries.
63 */ 63 */
64 class Iterator 64 class Iterator
65 { 65 {
66 public: 66 public:
67 Iterator(); 67 Iterator();
68 Iterator( const Iterator & ); 68 Iterator( const Iterator & );
69 ~Iterator(); 69 ~Iterator();
70 70
71 Iterator &operator=( const Iterator & ); 71 Iterator &operator=( const Iterator & );
72 const Addressee &operator*() const; 72 const Addressee &operator*() const;
73 Addressee &operator*(); 73 Addressee &operator*();
74 Addressee* operator->(); 74 Addressee* operator->();
75 Iterator &operator++(); 75 Iterator &operator++();
76 Iterator &operator++(int); 76 Iterator &operator++(int);
77 Iterator &operator--(); 77 Iterator &operator--();
78 Iterator &operator--(int); 78 Iterator &operator--(int);
79 bool operator==( const Iterator &it ); 79 bool operator==( const Iterator &it );
80 bool operator!=( const Iterator &it ); 80 bool operator!=( const Iterator &it );
81 81
82 struct IteratorData; 82 struct IteratorData;
83 IteratorData *d; 83 IteratorData *d;
84 }; 84 };
85 85
86 /** 86 /**
87 @short Address Book Const Iterator 87 @short Address Book Const Iterator
88 88
89 This class provides a const iterator for address book entries. 89 This class provides a const iterator for address book entries.
90 */ 90 */
91 class ConstIterator 91 class ConstIterator
92 { 92 {
93 public: 93 public:
94 ConstIterator(); 94 ConstIterator();
95 ConstIterator( const ConstIterator & ); 95 ConstIterator( const ConstIterator & );
96 ~ConstIterator(); 96 ~ConstIterator();
97 97
98 ConstIterator &operator=( const ConstIterator & ); 98 ConstIterator &operator=( const ConstIterator & );
99 const Addressee &operator*() const; 99 const Addressee &operator*() const;
100 const Addressee* operator->() const; 100 const Addressee* operator->() const;
101 ConstIterator &operator++(); 101 ConstIterator &operator++();
102 ConstIterator &operator++(int); 102 ConstIterator &operator++(int);
103 ConstIterator &operator--(); 103 ConstIterator &operator--();
104 ConstIterator &operator--(int); 104 ConstIterator &operator--(int);
105 bool operator==( const ConstIterator &it ); 105 bool operator==( const ConstIterator &it );
106 bool operator!=( const ConstIterator &it ); 106 bool operator!=( const ConstIterator &it );
107 107
108 struct ConstIteratorData; 108 struct ConstIteratorData;
109 ConstIteratorData *d; 109 ConstIteratorData *d;
110 }; 110 };
111 111
112 /** 112 /**
113 Constructs a address book object. 113 Constructs a address book object.
114 114
115 @param format File format class. 115 @param format File format class.
116 */ 116 */
117 AddressBook(); 117 AddressBook();
118 AddressBook( const QString &config ); 118 AddressBook( const QString &config );
119 AddressBook( const QString &config, const QString &family ); 119 AddressBook( const QString &config, const QString &family );
120 virtual ~AddressBook(); 120 virtual ~AddressBook();
121 121
122 /** 122 /**
123 Requests a ticket for saving the addressbook. Calling this function locks 123 Requests a ticket for saving the addressbook. Calling this function locks
124 the addressbook for all other processes. If the address book is already 124 the addressbook for all other processes. If the address book is already
125 locked the function returns 0. You need the returned @ref Ticket object 125 locked the function returns 0. You need the returned @ref Ticket object
126 for calling the @ref save() function. 126 for calling the @ref save() function.
127 127
128 @see save() 128 @see save()
129 */ 129 */
130 Ticket *requestSaveTicket( Resource *resource=0 ); 130 Ticket *requestSaveTicket( Resource *resource=0 );
131 131
132 /** 132 /**
133 Load address book from file. 133 Load address book from file.
134 */ 134 */
135 bool load(); 135 bool load();
136 136
137 /** 137 /**
138 Save address book. The address book is saved to the file, the Ticket 138 Save address book. The address book is saved to the file, the Ticket
139 object has been requested for by @ref requestSaveTicket(). 139 object has been requested for by @ref requestSaveTicket().
140 140
141 @param ticket a ticket object returned by @ref requestSaveTicket() 141 @param ticket a ticket object returned by @ref requestSaveTicket()
142 */ 142 */
143 bool save( Ticket *ticket ); 143 bool save( Ticket *ticket );
144 bool saveAB( ); 144 bool saveAB( );
145 bool saveABphone( QString fileName ); 145 bool saveABphone( QString fileName );
146 void smplifyAddressees(); 146 void smplifyAddressees();
147 void removeSyncInfo( QString syncProfile); 147 void removeSyncInfo( QString syncProfile);
148 void preparePhoneSync( QString currentSyncDevice, bool isPreSync ); 148 void preparePhoneSync( QString currentSyncDevice, bool isPreSync );
149 void export2File( QString fileName ); 149 void export2File( QString fileName, QString resourceName = "" );
150 bool export2PhoneFormat( QStringList uids ,QString fileName ); 150 bool export2PhoneFormat( QStringList uids ,QString fileName );
151 int importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false ); 151 int importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false );
152 void setUntagged( bool setNonSyncTagged = false ); 152 void setUntagged( bool setNonSyncTagged = false );
153 void removeUntagged(); 153 void removeUntagged();
154 void findNewExtIds( QString fileName, QString currentSyncDevice ); 154 void findNewExtIds( QString fileName, QString currentSyncDevice );
155 /** 155 /**
156 Returns a iterator for first entry of address book. 156 Returns a iterator for first entry of address book.
157 */ 157 */
158 Iterator begin(); 158 Iterator begin();
159 159
160 /** 160 /**
161 Returns a const iterator for first entry of address book. 161 Returns a const iterator for first entry of address book.
162 */ 162 */
163 ConstIterator begin() const; 163 ConstIterator begin() const;
164 164
165 /** 165 /**
166 Returns a iterator for first entry of address book. 166 Returns a iterator for first entry of address book.
167 */ 167 */
168 Iterator end(); 168 Iterator end();
169 169
170 /** 170 /**
171 Returns a const iterator for first entry of address book. 171 Returns a const iterator for first entry of address book.
172 */ 172 */
173 ConstIterator end() const; 173 ConstIterator end() const;
174 174
175 /** 175 /**
176 Removes all entries from address book. 176 Removes all entries from address book.
177 */ 177 */
178 void clear(); 178 void clear();
179 179
180 /** 180 /**
181 Insert an Addressee object into address book. If an object with the same 181 Insert an Addressee object into address book. If an object with the same
182 unique id already exists in the address book it it replaced by the new 182 unique id already exists in the address book it it replaced by the new
183 one. If not the new object is appended to the address book. 183 one. If not the new object is appended to the address book.
184 */ 184 */
185 void insertAddressee( const Addressee &, bool setRev = true, bool takeResource = false); 185 void insertAddressee( const Addressee &, bool setRev = true, bool takeResource = false);
186 186
187 /** 187 /**
188 Removes entry from the address book. 188 Removes entry from the address book.
189 */ 189 */
190 void removeAddressee( const Addressee & ); 190 void removeAddressee( const Addressee & );
191 191
192 /** 192 /**
193 This is like @ref removeAddressee() just above, with the difference that 193 This is like @ref removeAddressee() just above, with the difference that
194 the first element is a iterator, returned by @ref begin(). 194 the first element is a iterator, returned by @ref begin().
195 */ 195 */
196 void removeAddressee( const Iterator & ); 196 void removeAddressee( const Iterator & );
197 197
198 /** 198 /**
199 Find the specified entry in address book. Returns end(), if the entry 199 Find the specified entry in address book. Returns end(), if the entry
200 couldn't be found. 200 couldn't be found.
201 */ 201 */
202 Iterator find( const Addressee & ); 202 Iterator find( const Addressee & );
203 203
204 /** 204 /**
205 Find the entry specified by an unique id. Returns an empty Addressee 205 Find the entry specified by an unique id. Returns an empty Addressee
206 object, if the address book does not contain an entry with this id. 206 object, if the address book does not contain an entry with this id.
207 */ 207 */
208 Addressee findByUid( const QString & ); 208 Addressee findByUid( const QString & );
209 209
210 210
211 /** 211 /**
212 Returns a list of all addressees in the address book. This list can 212 Returns a list of all addressees in the address book. This list can
213 be sorted with @ref KABC::AddresseeList for example. 213 be sorted with @ref KABC::AddresseeList for example.
214 */ 214 */
215 Addressee::List allAddressees(); 215 Addressee::List allAddressees();
216 216
217 /** 217 /**
218 Find all entries with the specified name in the address book. Returns 218 Find all entries with the specified name in the address book. Returns
219 an empty list, if no entries could be found. 219 an empty list, if no entries could be found.
220 */ 220 */
221 Addressee::List findByName( const QString & ); 221 Addressee::List findByName( const QString & );
222 222
223 /** 223 /**
224 Find all entries with the specified email address in the address book. 224 Find all entries with the specified email address in the address book.
225 Returns an empty list, if no entries could be found. 225 Returns an empty list, if no entries could be found.
226 */ 226 */
227 Addressee::List findByEmail( const QString & ); 227 Addressee::List findByEmail( const QString & );
228 228
229 /** 229 /**
230 Find all entries wich have the specified category in the address book. 230 Find all entries wich have the specified category in the address book.
231 Returns an empty list, if no entries could be found. 231 Returns an empty list, if no entries could be found.
232 */ 232 */
233 Addressee::List findByCategory( const QString & ); 233 Addressee::List findByCategory( const QString & );
234 234
235 /** 235 /**
236 Return a string identifying this addressbook. 236 Return a string identifying this addressbook.
237 */ 237 */
238 virtual QString identifier(); 238 virtual QString identifier();
239 239
240 /** 240 /**
241 Used for debug output. 241 Used for debug output.
242 */ 242 */
243 void dump() const; 243 void dump() const;
244 244
245 void emitAddressBookLocked() { emit addressBookLocked( this ); } 245 void emitAddressBookLocked() { emit addressBookLocked( this ); }
246 void emitAddressBookUnlocked() { emit addressBookUnlocked( this ); } 246 void emitAddressBookUnlocked() { emit addressBookUnlocked( this ); }
247 void emitAddressBookChanged() { emit addressBookChanged( this ); } 247 void emitAddressBookChanged() { emit addressBookChanged( this ); }
248 248
249 /** 249 /**
250 Return list of all Fields known to the address book which are associated 250 Return list of all Fields known to the address book which are associated
251 with the given field category. 251 with the given field category.
252 */ 252 */
253 Field::List fields( int category = Field::All ); 253 Field::List fields( int category = Field::All );
254 254
255 /** 255 /**
256 Add custom field to address book. 256 Add custom field to address book.
257 257
258 @param label User visible label of the field. 258 @param label User visible label of the field.
259 @param category Ored list of field categories. 259 @param category Ored list of field categories.
260 @param key Identifier used as key for reading and writing the field. 260 @param key Identifier used as key for reading and writing the field.
261 @param app String used as application key for reading and writing 261 @param app String used as application key for reading and writing
262 the field. 262 the field.
263 */ 263 */
264 bool addCustomField( const QString &label, int category = Field::All, 264 bool addCustomField( const QString &label, int category = Field::All,
265 const QString &key = QString::null, 265 const QString &key = QString::null,
266 const QString &app = QString::null ); 266 const QString &app = QString::null );
267 267
268 268
269 /** 269 /**
270 Add address book resource. 270 Add address book resource.
271 */ 271 */
272 bool addResource( Resource * ); 272 bool addResource( Resource * );
273 273
274 /** 274 /**
275 Remove address book resource. 275 Remove address book resource.
276 */ 276 */
277 void removeResources(); 277 void removeResources();
278 bool removeResource( Resource * ); 278 bool removeResource( Resource * );
279 279
280 /** 280 /**
281 Return pointer list of all resources. 281 Return pointer list of all resources.
282 */ 282 */
283 QPtrList<Resource> resources(); 283 QPtrList<Resource> resources();
284 284
285 /** 285 /**
286 Set the @p ErrorHandler, that is used by @ref error() to 286 Set the @p ErrorHandler, that is used by @ref error() to
287 provide gui-independend error messages. 287 provide gui-independend error messages.
288 */ 288 */
289 void setErrorHandler( ErrorHandler * ); 289 void setErrorHandler( ErrorHandler * );
290 290
291 /** 291 /**
292 Shows gui independend error messages. 292 Shows gui independend error messages.
293 */ 293 */
294 void error( const QString& ); 294 void error( const QString& );
295 295
296 /** 296 /**
297 Query all resources to clean up their lock files 297 Query all resources to clean up their lock files
298 */ 298 */
299 void cleanUp(); 299 void cleanUp();
300 300
301 // sync stuff 301 // sync stuff
302 //Addressee::List getExternLastSyncAddressees(); 302 //Addressee::List getExternLastSyncAddressees();
303 void resetTempSyncStat(); 303 void resetTempSyncStat();
304 QStringList uidList(); 304 QStringList uidList();
305 void removeSyncAddressees( bool removeDeleted = false ); 305 void removeSyncAddressees( bool removeDeleted = false );
306 void mergeAB( AddressBook *aBook, const QString& profile, bool isSubset ); 306 void mergeAB( AddressBook *aBook, const QString& profile, bool isSubset );
307 const Addressee findByExternUid( const QString& uid , const QString& profile ) const; 307 const Addressee findByExternUid( const QString& uid , const QString& profile ) const;
308 bool containsExternalUid( const QString& uid ); 308 bool containsExternalUid( const QString& uid );
309 309
310 void preExternSync( AddressBook* aBook, const QString& csd, bool isSubset ); 310 void preExternSync( AddressBook* aBook, const QString& csd, bool isSubset );
311 void postExternSync( AddressBook* aBook, const QString& csd , bool setID ); 311 void postExternSync( AddressBook* aBook, const QString& csd , bool setID );
312 signals: 312 signals:
313 /** 313 /**
314 Emitted, when the address book has changed on disk. 314 Emitted, when the address book has changed on disk.
315 */ 315 */
316 void addressBookChanged( AddressBook * ); 316 void addressBookChanged( AddressBook * );
317 317
318 /** 318 /**
319 Emitted, when the address book has been locked for writing. 319 Emitted, when the address book has been locked for writing.
320 */ 320 */
321 void addressBookLocked( AddressBook * ); 321 void addressBookLocked( AddressBook * );
322 322
323 /** 323 /**
324 Emitted, when the address book has been unlocked. 324 Emitted, when the address book has been unlocked.
325 */ 325 */
326 void addressBookUnlocked( AddressBook * ); 326 void addressBookUnlocked( AddressBook * );
327 327
328 protected: 328 protected:
329 void deleteRemovedAddressees(); 329 void deleteRemovedAddressees();
330 void setStandardResource( Resource * ); 330 void setStandardResource( Resource * );
331 Resource *standardResource(); 331 Resource *standardResource();
332 KRES::Manager<Resource> *resourceManager(); 332 KRES::Manager<Resource> *resourceManager();
333 333
334 void init(const QString &config, const QString &family); 334 void init(const QString &config, const QString &family);
335 335
336 private: 336 private:
337//US QPtrList<Resource> mDummy; // Remove in KDE 4 337//US QPtrList<Resource> mDummy; // Remove in KDE 4
338 338
339 339
340 struct AddressBookData; 340 struct AddressBookData;
341 AddressBookData *d; 341 AddressBookData *d;