author | zautrix <zautrix> | 2005-01-18 22:46:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-18 22:46:53 (UTC) |
commit | bfb2947510c52f9c6b35c35786490f261adf30e3 (patch) (unidiff) | |
tree | 63b0efc7fcfb7715cf99cf8d8594ec5278926a77 /kaddressbook/xxport/vcard_xxport.cpp | |
parent | 7200aeadd415cf88b909c00d1414f212cf85b3df (diff) | |
download | kdepimpi-bfb2947510c52f9c6b35c35786490f261adf30e3.zip kdepimpi-bfb2947510c52f9c6b35c35786490f261adf30e3.tar.gz kdepimpi-bfb2947510c52f9c6b35c35786490f261adf30e3.tar.bz2 |
another fix
Diffstat (limited to 'kaddressbook/xxport/vcard_xxport.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kaddressbook/xxport/vcard_xxport.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp index acf6419..c56be8b 100644 --- a/kaddressbook/xxport/vcard_xxport.cpp +++ b/kaddressbook/xxport/vcard_xxport.cpp | |||
@@ -32,2 +32,3 @@ $Id$ | |||
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qfileinfo.h> | ||
33 | 34 | ||
@@ -148,6 +149,4 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const | |||
148 | url = XXPortManager::importURL; | 149 | url = XXPortManager::importURL; |
149 | |||
150 | if ( url.isEmpty() ) | 150 | if ( url.isEmpty() ) |
151 | return addrList; | 151 | return addrList; |
152 | |||
153 | QString caption( i18n( "vCard Import Failed" ) ); | 152 | QString caption( i18n( "vCard Import Failed" ) ); |
@@ -183,5 +182,8 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const | |||
183 | fileName = KFileDialog::getOpenFileName( QString::null, i18n("Select vCard to Import"), parentWidget() ); | 182 | fileName = KFileDialog::getOpenFileName( QString::null, i18n("Select vCard to Import"), parentWidget() ); |
183 | |||
184 | if ( fileName.isEmpty() ) | 184 | if ( fileName.isEmpty() ) |
185 | return addrList; | 185 | return addrList; |
186 | 186 | QFileInfo fi ( fileName ); | |
187 | if ( !fi.isFile() ) | ||
188 | return addrList; | ||
187 | } | 189 | } |
@@ -195,12 +197,9 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const | |||
195 | } | 197 | } |
196 | |||
197 | |||
198 | QFile file( fileName ); | 198 | QFile file( fileName ); |
199 | 199 | if ( file.open( IO_ReadOnly ) ) { | |
200 | file.open( IO_ReadOnly ); | ||
201 | QByteArray rawData = file.readAll(); | 200 | QByteArray rawData = file.readAll(); |
202 | file.close(); | 201 | file.close(); |
203 | |||
204 | QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); | 202 | QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); |
205 | addrList = parseVCard( data ); | 203 | addrList = parseVCard( data ); |
204 | } | ||
206 | 205 | ||