summaryrefslogtreecommitdiffabout
path: root/kaddressbook/xxport/vcard_xxport.cpp
Unidiff
Diffstat (limited to 'kaddressbook/xxport/vcard_xxport.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/xxport/vcard_xxport.cpp1
1 files changed, 0 insertions, 1 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
100 if ( fileName.isEmpty() ) 100 if ( fileName.isEmpty() )
101 return false; 101 return false;
102 102
103 QFile outFile( fileName ); 103 QFile outFile( fileName );
104 if ( !outFile.open( IO_WriteOnly ) ) { 104 if ( !outFile.open( IO_WriteOnly ) ) {
105 QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" ); 105 QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" );
106 KMessageBox::error( parentWidget(), text.arg( fileName ) ); 106 KMessageBox::error( parentWidget(), text.arg( fileName ) );
107 return false; 107 return false;
108 } 108 }
109 109
110 QTextStream t( &outFile ); 110 QTextStream t( &outFile );
111 t.setEncoding( QTextStream::UnicodeUTF8 ); 111 t.setEncoding( QTextStream::UnicodeUTF8 );
112 112
113 KABC::Addressee::List::ConstIterator it; 113 KABC::Addressee::List::ConstIterator it;
114 for ( it = list.begin(); it != list.end(); ++it ) { 114 for ( it = list.begin(); it != list.end(); ++it ) {
115 KABC::VCardConverter converter; 115 KABC::VCardConverter converter;
116 QString vcard; 116 QString vcard;
117 117
118 KABC::VCardConverter::Version version; 118 KABC::VCardConverter::Version version;
119 if ( data == "v21" ) 119 if ( data == "v21" )
120 version = KABC::VCardConverter::v2_1; 120 version = KABC::VCardConverter::v2_1;
121 else 121 else
122 version = KABC::VCardConverter::v3_0; 122 version = KABC::VCardConverter::v3_0;
123 123
124 version = KABC::VCardConverter::v2_1;
125 converter.addresseeToVCard( *it, vcard, version ); 124 converter.addresseeToVCard( *it, vcard, version );
126 t << vcard << "\r\n\r\n"; 125 t << vcard << "\r\n\r\n";
127 } 126 }
128 127
129 outFile.close(); 128 outFile.close();
130 129
131 return true; 130 return true;
132} 131}
133 132
134KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const 133KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
135{ 134{
136 QString fileName; 135 QString fileName;
137 KABC::AddresseeList addrList; 136 KABC::AddresseeList addrList;
138 KURL url; 137 KURL url;
139 138
140#ifndef KAB_EMBEDDED 139#ifndef KAB_EMBEDDED
141 if ( !XXPortManager::importData.isEmpty() ) 140 if ( !XXPortManager::importData.isEmpty() )
142 addrList = parseVCard( XXPortManager::importData ); 141 addrList = parseVCard( XXPortManager::importData );
143 else { 142 else {
144 if ( XXPortManager::importURL.isEmpty() ) 143 if ( XXPortManager::importURL.isEmpty() )
145 { 144 {
146 url = KFileDialog::getLoadFileName( QString::null, i18n("Select vCard to Import"), parentWidget() ); 145 url = KFileDialog::getLoadFileName( QString::null, i18n("Select vCard to Import"), parentWidget() );
147 } 146 }
148 else 147 else