author | ulf69 <ulf69> | 2004-07-01 01:38:43 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-01 01:38:43 (UTC) |
commit | c381e615f02b1bc0241719701725a65be46b6326 (patch) (side-by-side diff) | |
tree | 01ec97849667e96b952803aab08a79272bae5640 /kaddressbook | |
parent | d419ee83db7d2549c701fe89b678be619a7ce4d3 (diff) | |
download | kdepimpi-c381e615f02b1bc0241719701725a65be46b6326.zip kdepimpi-c381e615f02b1bc0241719701725a65be46b6326.tar.gz kdepimpi-c381e615f02b1bc0241719701725a65be46b6326.tar.bz2 |
*** empty log message ***
-rw-r--r-- | kaddressbook/xxport/opie/opie_xxport.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/xxport/opie/opie_xxport.cpp b/kaddressbook/xxport/opie/opie_xxport.cpp index 616eec1..90d05cd 100644 --- a/kaddressbook/xxport/opie/opie_xxport.cpp +++ b/kaddressbook/xxport/opie/opie_xxport.cpp @@ -63,97 +63,97 @@ class OpieXXPortFactory : public XXPortFactory XXPortObject *xxportObject( KABC::AddressBook *ab, QWidget *parent, const char *name ) { return new OpieXXPort( ab, parent, name ); } }; extern "C" { void *init_kaddrbk_opie_xxport() { return ( new OpieXXPortFactory() ); } } OpieXXPort::OpieXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) : XXPortObject( ab, parent, name ) { createImportAction( i18n( "Import Opie..." ) ); createExportAction( i18n( "Export Opie..." ) ); } bool OpieXXPort::exportContacts( const KABC::AddresseeList &list, const QString &data ) { QString name = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml"; #ifndef KAB_EMBEDDED QString fileName = KFileDialog::getSaveFileName( name ); #else //KAB_EMBEDDED QString fileName = KFileDialog::getSaveFileName( name, i18n("Save file"), parentWidget() ); #endif //KAB_EMBEDDED if ( fileName.isEmpty() ) return true; OContactAccess* access = new OContactAccess("KA/Pi", fileName, 0l, false); if ( !access ) { qDebug("Unable to access file() %s", fileName.latin1()); addressBook()->error( i18n( "Unable to access file '%1'." ).arg( fileName ) ); return false; } //Now check if the file has already entries, and ask the user if he wants to delete them first. OContactAccess::List contactList = access->allRecords(); if (contactList.count() > 0) { - QString text( i18n( "<qt>Do you want to remove all existing entries from <b>%1</b> before exporting.?</qt>" ) ); + QString text( i18n( "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?" ) ); if ( KMessageBox::questionYesNo( parentWidget(), text.arg( fileName ) ) == KMessageBox::Yes ) { // Clean the database.. access->clear(); } } KABC::OpieConverter mConverter; bool res; KABC::Addressee::List::ConstIterator it; for ( it = list.begin(); it != list.end(); ++it ) { OContact c; KABC::Addressee addressee = (*it); res = mConverter.addresseeToOpie( *it, c ); if (res == true) { res = access->add(c); if (res == false) qDebug("Unable to append Contact %s", c.fullName().latin1()); } else { qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1()); } } access->save(); delete access; return true; } KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const { KABC::AddresseeList adrlst; QString name = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml"; #ifndef KAB_EMBEDDED QString fileName = KFileDialog::getOpenFileName( name ); #else //KAB_EMBEDDED QString fileName = KFileDialog::getOpenFileName( name, i18n("Load file"), parentWidget() ); #endif //KAB_EMBEDDED if ( fileName.isEmpty() ) return KABC::AddresseeList(); |