-rw-r--r-- | bin/kdepim/WhatsNew.txt | 1 | ||||
-rw-r--r-- | kaddressbook/xxportmanager.cpp | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 15caf9e..fd5e4f9 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -1,23 +1,24 @@ Info about the changes in new versions of KDE-Pim/Pi ********** VERSION 2.2.1 ************ KO/Pi: Fixed a problem displaying very long allday events in agenda view in single day mode. Fixed a problem with the default settings for new todos. KA/Pi: Added a config option to turn on asking before a contact is deleted. Fixed a problem with the default view and view selection at startup. +Formatted name is now set on import, if formatted name is empty. ********** VERSION 2.2.0 ************ New stable release! Fixed some minor usability problems. Added writing of next alarm to a file for usage on pdaXrom. ************************************* You can find the complete changelog from version 1.7.7 to 2.2.0 diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp index 7cb67ed..405f7ec 100644 --- a/kaddressbook/xxportmanager.cpp +++ b/kaddressbook/xxportmanager.cpp @@ -50,24 +50,25 @@ extern "C" void* init_microkaddrbk_qtopia_xxport(); void* init_microkaddrbk_sharpdtm_xxport(); } #endif //KAB_EMBEDDED #include <addresseeview.h> #include "kabcore.h" #include "undocmds.h" #include "xxportselectdialog.h" #include "xxportmanager.h" +#include "nameeditdialog.h" KURL XXPortManager::importURL = KURL(); QString XXPortManager::importData = QString::null; class PreviewDialog : public KDialogBase { public: PreviewDialog( const KABC::Addressee &addr, QWidget *parent, const char *name = 0 ); }; XXPortManager::XXPortManager( KABCore *core, QObject *parent, const char *name ) @@ -123,50 +124,56 @@ void XXPortManager::slotImport( const QString &identifier, const QString &data ) if ( !resource ) return; KABC::AddresseeList list = obj->importContacts( data ); bool useUndo = ( list.count() < 25 ); #ifdef DESKTOP_VERSION useUndo = true; #endif mShowPreview = true; KABC::AddresseeList::Iterator it; bool imported = false; int count = 0; + + KConfig config( locateLocal("config", "kabcrc") ); + config.setGroup( "General" ); + int FormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); + + for ( it = list.begin(); it != list.end(); ++it ) { if ( mShowPreview ) { PreviewDialog dlg( *it, mCore ); connect( &dlg, SIGNAL( closeClicked() ), this, SLOT ( noPreview()) ); if ( !dlg.exec() ) { if ( mShowPreview ) continue; } } - (*it).setResource( resource ); + if ( (*it).formattedName().isEmpty() ) + (*it).setFormattedName( NameEditDialog::formattedName( (*it), FormattedNameType ) ); if ( useUndo ) { + ++count; // We use a PwNewCommand so the user can undo it. PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); UndoStack::instance()->push( command ); RedoStack::instance()->clear(); } else { ++count; mCore->addressBook()->insertAddressee( (*it), true, true ); } imported = true; } - if ( imported ) { KMessageBox::information( mCore, i18n( "%1 contacts\nsuccessfully\nimported.").arg( count) ); - emit modified(); } } void XXPortManager::noPreview() { mShowPreview = false; } void XXPortManager::slotExport( const QString &identifier, const QString &data ) { XXPortObject *obj = mXXPortObjects[ identifier ]; if ( !obj ) { KMessageBox::error( mCore, i18n( "<qt>No export plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); |