Diffstat (limited to 'kaddressbook/xxport/vcard_xxport.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/xxport/vcard_xxport.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp index c017f5b..54d0cbd 100644 --- a/kaddressbook/xxport/vcard_xxport.cpp +++ b/kaddressbook/xxport/vcard_xxport.cpp | |||
@@ -170,33 +170,37 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const | |||
170 | } | 170 | } |
171 | 171 | ||
172 | 172 | ||
173 | #else //KAB_EMBEDDED | 173 | #else //KAB_EMBEDDED |
174 | 174 | ||
175 | 175 | ||
176 | if ( !XXPortManager::importData.isEmpty() ) | 176 | if ( !XXPortManager::importData.isEmpty() ) |
177 | addrList = parseVCard( XXPortManager::importData ); | 177 | addrList = parseVCard( XXPortManager::importData ); |
178 | else { | 178 | else { |
179 | if ( XXPortManager::importURL.isEmpty() ) | 179 | if ( XXPortManager::importURL.isEmpty() ) |
180 | { | 180 | { |
181 | fileName = KFileDialog::getOpenFileName( QString::null, i18n("Select vCard to Import"), parentWidget() ); | 181 | fileName = KFileDialog::getOpenFileName( QString::null, i18n("Select vCard to Import"), parentWidget() ); |
182 | if ( fileName.isEmpty() ) | ||
183 | return addrList; | ||
184 | |||
182 | } | 185 | } |
183 | else | 186 | else |
184 | { | 187 | { |
185 | //US url = XXPortManager::importURL; | 188 | //US url = XXPortManager::importURL; |
186 | qDebug("VCardXXPort::importContacts Urls at the moment not supported"); | 189 | qDebug("VCardXXPort::importContacts Urls at the moment not supported"); |
190 | if ( url.isEmpty() ) | ||
191 | return addrList; | ||
192 | |||
187 | } | 193 | } |
188 | 194 | ||
189 | if ( url.isEmpty() ) | ||
190 | return addrList; | ||
191 | 195 | ||
192 | QFile file( fileName ); | 196 | QFile file( fileName ); |
193 | 197 | ||
194 | file.open( IO_ReadOnly ); | 198 | file.open( IO_ReadOnly ); |
195 | QByteArray rawData = file.readAll(); | 199 | QByteArray rawData = file.readAll(); |
196 | file.close(); | 200 | file.close(); |
197 | 201 | ||
198 | QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); | 202 | QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); |
199 | addrList = parseVCard( data ); | 203 | addrList = parseVCard( data ); |
200 | 204 | ||
201 | } | 205 | } |
202 | #endif //KAB_EMBEDDED | 206 | #endif //KAB_EMBEDDED |