-rw-r--r-- | kaddressbook/xxportmanager.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp index 4798ffe..2962951 100644 --- a/kaddressbook/xxportmanager.cpp +++ b/kaddressbook/xxportmanager.cpp @@ -128,20 +128,20 @@ void XXPortManager::slotImport( const QString &identifier, const QString &data ) PreviewDialog dlg( *it, mCore ); if ( !dlg.exec() ) continue; } - + (*it).setResource( resource ); // We use a PwNewCommand so the user can undo it. PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); UndoStack::instance()->push( command ); RedoStack::instance()->clear(); imported = true; } - + if ( imported ) { KMessageBox::information( mCore, i18n( "contacts successfully imported." ) ); - + emit modified(); } } @@ -175,9 +175,9 @@ void XXPortManager::loadPlugins() KTrader::OfferList::ConstIterator it; for ( it = plugins.begin(); it != plugins.end(); ++it ) { if ( !(*it)->hasServiceType( "KAddressBook/XXPort" ) ) continue; - + KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); if ( !factory ) { kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl; continue; @@ -188,9 +188,9 @@ void XXPortManager::loadPlugins() if ( !xxportFactory ) { kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl; continue; } - + #else //KAB_EMBEDDED QList<XXPortFactory> factorylist; factorylist.append(static_cast<XXPortFactory*>(init_kaddrbk_csv_xxport())); factorylist.append(static_cast<XXPortFactory*>(init_kaddrbk_kde2_xxport())); @@ -208,10 +208,17 @@ void XXPortManager::loadPlugins() if ( factory ) { XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); factorylist.append(xxportFactory); } - - QListIterator<XXPortFactory> it(factorylist); + + //add the sharp import library dynamically + factory = KLibLoader::self()->factory( "microkaddrbk_sharpdtm_xxport" ); + if ( factory ) { + XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); + factorylist.append(xxportFactory); + } + + QListIterator<XXPortFactory> it(factorylist); for ( ; it.current(); ++it ) { XXPortFactory *xxportFactory = it.current(); #endif //KAB_EMBEDDED @@ -235,9 +242,9 @@ PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, name, true, true ) { QWidget *page = plainPage(); QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); - + KPIM::AddresseeView *view = new KPIM::AddresseeView( page ); view->setAddressee( addr ); layout->addWidget( view ); |