From e87df879ceaa743c95d2b48c291c3c35f8ed6b3f Mon Sep 17 00:00:00 2001 From: ulf69 Date: Fri, 16 Jul 2004 23:25:52 +0000 Subject: load the sharp dtm lib automatically if it exists --- (limited to 'kaddressbook/xxportmanager.cpp') diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp index 4798ffe..2962951 100644 --- a/kaddressbook/xxportmanager.cpp +++ b/kaddressbook/xxportmanager.cpp @@ -129,7 +129,7 @@ void XXPortManager::slotImport( const QString &identifier, const QString &data ) if ( !dlg.exec() ) continue; } - + (*it).setResource( resource ); // We use a PwNewCommand so the user can undo it. PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); @@ -137,10 +137,10 @@ void XXPortManager::slotImport( const QString &identifier, const QString &data ) RedoStack::instance()->clear(); imported = true; } - + if ( imported ) { KMessageBox::information( mCore, i18n( "contacts successfully imported." ) ); - + emit modified(); } } @@ -176,7 +176,7 @@ void XXPortManager::loadPlugins() 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; @@ -189,7 +189,7 @@ void XXPortManager::loadPlugins() kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl; continue; } - + #else //KAB_EMBEDDED QList factorylist; factorylist.append(static_cast(init_kaddrbk_csv_xxport())); @@ -209,8 +209,15 @@ void XXPortManager::loadPlugins() XXPortFactory *xxportFactory = static_cast( factory ); factorylist.append(xxportFactory); } - - QListIterator it(factorylist); + + //add the sharp import library dynamically + factory = KLibLoader::self()->factory( "microkaddrbk_sharpdtm_xxport" ); + if ( factory ) { + XXPortFactory *xxportFactory = static_cast( factory ); + factorylist.append(xxportFactory); + } + + QListIterator it(factorylist); for ( ; it.current(); ++it ) { XXPortFactory *xxportFactory = it.current(); @@ -236,7 +243,7 @@ PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, { QWidget *page = plainPage(); QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); - + KPIM::AddresseeView *view = new KPIM::AddresseeView( page ); view->setAddressee( addr ); -- cgit v0.9.0.2