summaryrefslogtreecommitdiffabout
path: root/kaddressbook/xxport/opie/opie_xxport.cpp
Unidiff
Diffstat (limited to 'kaddressbook/xxport/opie/opie_xxport.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxport/opie/opie_xxport.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/kaddressbook/xxport/opie/opie_xxport.cpp b/kaddressbook/xxport/opie/opie_xxport.cpp
index 12c83af..db30d34 100644
--- a/kaddressbook/xxport/opie/opie_xxport.cpp
+++ b/kaddressbook/xxport/opie/opie_xxport.cpp
@@ -175,26 +175,35 @@ KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const
175 OContactAccessBackend_XML* backend = new OContactAccessBackend_XML( "KA/Pi", fileName ); 175 OContactAccessBackend_XML* backend = new OContactAccessBackend_XML( "KA/Pi", fileName );
176 OContactAccess* access = new OContactAccess("KA/Pi", 0l, backend, false); 176 OContactAccess* access = new OContactAccess("KA/Pi", 0l, backend, false);
177 177
178 if ( !access ) { 178 if ( !access ) {
179 qDebug("Unable to access file() %s", fileName.latin1()); 179 qDebug("Unable to access file() %s", fileName.latin1());
180 addressBook()->error( i18n( "Unable to access file '%1'." ).arg( fileName ) ); 180 addressBook()->error( i18n( "Unable to access file '%1'." ).arg( fileName ) );
181 return KABC::AddresseeList(); 181 return KABC::AddresseeList();
182 } 182 }
183 183
184 access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available 184 access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available
185 185
186 KABC::OpieConverter mConverter; 186 KABC::OpieConverter mConverter;
187 bool res = false;
188 187
188 bool res = mConverter.init();
189 if (!res)
190 {
191 QString text( i18n( "Unable to initialize opie converter.<br>Most likely a problem with the category file." ) );
192 qDebug(text);
193 KMessageBox::error( parentWidget(), text );
194 delete access;
195 return KABC::AddresseeList();
196 }
197
189 198
190 OContactAccess::List::Iterator it; 199 OContactAccess::List::Iterator it;
191 OContactAccess::List allList = access->allRecords(); 200 OContactAccess::List allList = access->allRecords();
192 for ( it = allList.begin(); it != allList.end(); ++it ) 201 for ( it = allList.begin(); it != allList.end(); ++it )
193 { 202 {
194 OContact c = (*it); 203 OContact c = (*it);
195 204
196 KABC::Addressee addressee; 205 KABC::Addressee addressee;
197 206
198 res = mConverter.opieToAddressee( c, addressee ); 207 res = mConverter.opieToAddressee( c, addressee );
199 208
200 if ( !addressee.isEmpty() && res ) { 209 if ( !addressee.isEmpty() && res ) {