From 6f2ccd235ef49d5606ecf4e540e8884f7a9b7ec4 Mon Sep 17 00:00:00 2001 From: ulf69 Date: Tue, 20 Jul 2004 21:28:10 +0000 Subject: remove the export was successfull dialog if the user canceled the operation --- (limited to 'kaddressbook/xxport/vcard_xxport.cpp') diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp index adf47cd..4819341 100644 --- a/kaddressbook/xxport/vcard_xxport.cpp +++ b/kaddressbook/xxport/vcard_xxport.cpp @@ -90,15 +90,15 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &list, const QString name = list[ 0 ].givenName() + "_" + list[ 0 ].familyName() + ".vcf"; else name = "addressbook.vcf"; - + #ifndef KAB_EMBEDDED QString fileName = KFileDialog::getSaveFileName( name ); #else //KAB_EMBEDDED QString fileName = KFileDialog::getSaveFileName( name, i18n("Save file"), parentWidget() ); #endif //KAB_EMBEDDED - + if ( fileName.isEmpty() ) - return true; + return false; QFile outFile( fileName ); if ( !outFile.open( IO_WriteOnly ) ) { @@ -168,13 +168,13 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const QString text = i18n( "Unable to access %1." ); KMessageBox::error( parentWidget(), text.arg( url.url() ), caption ); } - + } - + #else //KAB_EMBEDDED - - + + if ( !XXPortManager::importData.isEmpty() ) addrList = parseVCard( XXPortManager::importData ); else { @@ -183,7 +183,7 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const fileName = KFileDialog::getOpenFileName( QString::null, i18n("Select vCard to Import"), parentWidget() ); if ( fileName.isEmpty() ) return addrList; - + } else { @@ -191,10 +191,10 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const qDebug("VCardXXPort::importContacts Urls at the moment not supported"); if ( url.isEmpty() ) return addrList; - + } - + QFile file( fileName ); file.open( IO_ReadOnly ); @@ -203,16 +203,16 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); addrList = parseVCard( data ); - + } -#endif //KAB_EMBEDDED - +#endif //KAB_EMBEDDED + return addrList; } KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const -{ - +{ + KABC::VCardTool tool; KABC::AddresseeList addrList; addrList = tool.parseVCards( data ); -- cgit v0.9.0.2