author | eilers <eilers> | 2002-12-11 17:15:12 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-12-11 17:15:12 (UTC) |
commit | 9f5e007f4859027eaeb989c620ec62fc698b44cc (patch) (side-by-side diff) | |
tree | f87f5882e5e9f87c32ac3833d9396a0de16b1c40 | |
parent | 77b921d0269820b16d8ec613fb8de578638d372e (diff) | |
download | opie-9f5e007f4859027eaeb989c620ec62fc698b44cc.zip opie-9f5e007f4859027eaeb989c620ec62fc698b44cc.tar.gz opie-9f5e007f4859027eaeb989c620ec62fc698b44cc.tar.bz2 |
Added dialogbox to notify that the vcard was unable to read
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index e009d52..a1ce5a0 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -332,48 +332,54 @@ void AddressbookWindow::setDocument( const QString &filename ) switch( QMessageBox::information( this, tr ( "Right file type ?" ), tr( "The selected file \n does not end with \".vcf\".\n Do you really want to open it?" ), tr( "&Yes" ), tr( "&No" ), QString::null, 0, // Enter == button 0 2 ) ) { // Escape == button 2 case 0: qWarning("YES clicked"); break; case 1: qWarning("NO clicked"); return; break; } } OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, filename ); OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); OContactAccess::List allList = access->allRecords(); qWarning( "Found number of contacts in File: %d", allList.count() ); + if ( !allList.count() ) { + QMessageBox::information( this, "Import VCard", + "It was impossible to import the VCard.\n" + "The VCard may be corrupted !" ); + } + bool doAsk = true; OContactAccess::List::Iterator it; for ( it = allList.begin(); it != allList.end(); ++it ){ qWarning("Adding Contact from: %s", (*it).fullName().latin1() ); if ( doAsk ){ switch( QMessageBox::information( this, tr ( "Add Contact ?" ), tr( "Do you really want add contact for \n%1 ?" ) .arg( (*it).fullName().latin1() ), tr( "&Yes" ), tr( "&No" ), tr( "&AllYes"), 0, // Enter == button 0 2 ) ) { // Escape == button 2 case 0: qWarning("YES clicked"); m_abView->addEntry( *it ); break; case 1: qWarning("NO clicked"); break; case 2: qWarning("YesAll clicked"); doAsk = false; break; } }else |