author | eilers <eilers> | 2004-12-20 14:19:24 (UTC) |
---|---|---|
committer | eilers <eilers> | 2004-12-20 14:19:24 (UTC) |
commit | 29f05e7138a05c2c32cad8b40fd432cd383964a9 (patch) (side-by-side diff) | |
tree | 2f80ace57f99ce24ac8c1e8a556c08e07ca18019 /core/pim/addressbook/addressbook.cpp | |
parent | 18e47153532d016d878f47e0ce11cb1a9716218e (diff) | |
download | opie-29f05e7138a05c2c32cad8b40fd432cd383964a9.zip opie-29f05e7138a05c2c32cad8b40fd432cd383964a9.tar.gz opie-29f05e7138a05c2c32cad8b40fd432cd383964a9.tar.bz2 |
Fix for Bug #1269 and use of new sorted of the pim libary
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 835038a..0654e1a 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -331,48 +331,55 @@ void AddressbookWindow::exportvCard() odebug << " Save to file " << filename << ", (" << filename.length()-1 << ")" << oendl; Opie::OPimContact curCont = m_abView->currentEntry(); if ( !curCont.isEmpty() ){ Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, filename ); Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook_exp", QString::null , vcard_backend, true ); if ( access ){ access->add( curCont ); access->save(); } delete access; }else QMessageBox::critical( 0, "Export VCard", QString( tr( "You have to select a contact !") ) ); }else QMessageBox::critical( 0, "Export VCard", QString( tr( "You have to set a filename !") ) ); } void AddressbookWindow::setDocument( const QString &filename ) { odebug << "void AddressbookWindow::setDocument( " << filename << " )" << oendl; + // Switch to default backend. This should avoid to import into + // the personal database accidently. + if ( actionPersonal->isOn() ){ + actionPersonal->setOn( false ); + slotPersonalView(); + } + if ( filename.find(".vcf") != int(filename.length()) - 4 ){ 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: odebug << "YES clicked" << oendl; break; case 1: odebug << "NO clicked" << oendl; return; break; } } Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, filename ); Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); Opie::OPimContactAccess::List allList = access->allRecords(); odebug << "Found number of contacts in File: " << allList.count() << oendl; |