summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/xxport/vcard_xxport.cpp1
-rw-r--r--kaddressbook/xxportmanager.cpp1
2 files changed, 0 insertions, 2 deletions
diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp
index 3079d42..acf6419 100644
--- a/kaddressbook/xxport/vcard_xxport.cpp
+++ b/kaddressbook/xxport/vcard_xxport.cpp
@@ -100,49 +100,48 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &list, const QString
if ( fileName.isEmpty() )
return false;
QFile outFile( fileName );
if ( !outFile.open( IO_WriteOnly ) ) {
QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" );
KMessageBox::error( parentWidget(), text.arg( fileName ) );
return false;
}
QTextStream t( &outFile );
t.setEncoding( QTextStream::UnicodeUTF8 );
KABC::Addressee::List::ConstIterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
KABC::VCardConverter converter;
QString vcard;
KABC::VCardConverter::Version version;
if ( data == "v21" )
version = KABC::VCardConverter::v2_1;
else
version = KABC::VCardConverter::v3_0;
- version = KABC::VCardConverter::v2_1;
converter.addresseeToVCard( *it, vcard, version );
t << vcard << "\r\n\r\n";
}
outFile.close();
return true;
}
KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
{
QString fileName;
KABC::AddresseeList addrList;
KURL url;
#ifndef KAB_EMBEDDED
if ( !XXPortManager::importData.isEmpty() )
addrList = parseVCard( XXPortManager::importData );
else {
if ( XXPortManager::importURL.isEmpty() )
{
url = KFileDialog::getLoadFileName( QString::null, i18n("Select vCard to Import"), parentWidget() );
}
else
diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp
index 810c3e2..1f0c9ea 100644
--- a/kaddressbook/xxportmanager.cpp
+++ b/kaddressbook/xxportmanager.cpp
@@ -141,49 +141,48 @@ void XXPortManager::slotImport( const QString &identifier, const QString &data )
imported = true;
}
if ( imported ) {
KMessageBox::information( mCore, i18n( "contacts successfully imported." ) );
emit modified();
}
}
void XXPortManager::slotExport( const QString &identifier, const QString &data )
{
XXPortObject *obj = mXXPortObjects[ identifier ];
if ( !obj ) {
KMessageBox::error( mCore, i18n( "<qt>No export plugin available for <b>%1</b>.</qt>" ).arg( identifier ) );
return;
}
KABC::AddresseeList addrList;
XXPortSelectDialog dlg( mCore, obj->requiresSorting(), mCore );
if ( dlg.exec() )
addrList = dlg.contacts();
else
return;
-
if ( !obj->exportContacts( addrList, data ) )
KMessageBox::error( mCore, i18n( "Unable to export contacts." ) );
else
KMessageBox::information( mCore, i18n( "contacts successfully exported." ) );
}
void XXPortManager::loadPlugins()
{
mXXPortObjects.clear();
#ifndef KAB_EMBEDDED
KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/XXPort" );
KTrader::OfferList::ConstIterator it;
for ( it = plugins.begin(); it != plugins.end(); ++it ) {
if ( !(*it)->hasServiceType( "KAddressBook/XXPort" ) )
continue;
KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() );
if ( !factory ) {
kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl;
continue;
}
XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory );