summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 60db2b4..e009d52 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -348,16 +348,40 @@ void AddressbookWindow::setDocument( const QString &filename )
348 } 348 }
349 349
350 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, 350 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
351 filename ); 351 filename );
352 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); 352 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true );
353 OContactAccess::List allList = access->allRecords(); 353 OContactAccess::List allList = access->allRecords();
354 qWarning( "Found number of contacts in File: %d", allList.count() );
354 355
356 bool doAsk = true;
355 OContactAccess::List::Iterator it; 357 OContactAccess::List::Iterator it;
356 for ( it = allList.begin(); it != allList.end(); ++it ){ 358 for ( it = allList.begin(); it != allList.end(); ++it ){
357 m_abView->addEntry( *it ); 359 qWarning("Adding Contact from: %s", (*it).fullName().latin1() );
360 if ( doAsk ){
361 switch( QMessageBox::information( this, tr ( "Add Contact ?" ),
362 tr( "Do you really want add contact for \n%1 ?" )
363 .arg( (*it).fullName().latin1() ),
364 tr( "&Yes" ), tr( "&No" ), tr( "&AllYes"),
365 0, // Enter == button 0
366 2 ) ) { // Escape == button 2
367 case 0:
368 qWarning("YES clicked");
369 m_abView->addEntry( *it );
370 break;
371 case 1:
372 qWarning("NO clicked");
373 break;
374 case 2:
375 qWarning("YesAll clicked");
376 doAsk = false;
377 break;
378 }
379 }else
380 m_abView->addEntry( *it );
381
358 } 382 }
359 383
360 delete access; 384 delete access;
361} 385}
362 386
363void AddressbookWindow::resizeEvent( QResizeEvent *e ) 387void AddressbookWindow::resizeEvent( QResizeEvent *e )