summaryrefslogtreecommitdiffabout
path: root/kaddressbook/xxportmanager.cpp
authorulf69 <ulf69>2004-07-16 23:25:52 (UTC)
committer ulf69 <ulf69>2004-07-16 23:25:52 (UTC)
commite87df879ceaa743c95d2b48c291c3c35f8ed6b3f (patch) (side-by-side diff)
treef144099674f805ca7775d6d8a4129871887869de /kaddressbook/xxportmanager.cpp
parentb78f5351ef7432aae4104ed306b52975c91eacb0 (diff)
downloadkdepimpi-e87df879ceaa743c95d2b48c291c3c35f8ed6b3f.zip
kdepimpi-e87df879ceaa743c95d2b48c291c3c35f8ed6b3f.tar.gz
kdepimpi-e87df879ceaa743c95d2b48c291c3c35f8ed6b3f.tar.bz2
load the sharp dtm lib automatically if it exists
Diffstat (limited to 'kaddressbook/xxportmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxportmanager.cpp23
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
@@ -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<XXPortFactory> factorylist;
factorylist.append(static_cast<XXPortFactory*>(init_kaddrbk_csv_xxport()));
@@ -209,8 +209,15 @@ void XXPortManager::loadPlugins()
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();
@@ -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 );