Diffstat (limited to 'kaddressbook/extensionmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/extensionmanager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kaddressbook/extensionmanager.cpp b/kaddressbook/extensionmanager.cpp index 98561dc..efbdf17 100644 --- a/kaddressbook/extensionmanager.cpp +++ b/kaddressbook/extensionmanager.cpp @@ -45,32 +45,33 @@ ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent, : QScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 ) { #ifdef KAB_EMBEDDED //US QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); QWidget *settingsmenu = (QWidget*)mCore->getSettingsMenu(); #endif //KAB_EMBEDDED mActionExtensions = new KSelectAction( i18n( "Show Extension Bar" ), 0, mCore->actionCollection(), "options_show_extensions" ); mActionExtensions->plug( settingsmenu ); connect( mActionExtensions, SIGNAL( activated( int ) ), SLOT( setActiveExtension( int ) ) ); mWidgetBox = new QWidget( viewport() ); + new QHBoxLayout (mWidgetBox ); addChild( mWidgetBox ); setResizePolicy(AutoOneFit); createExtensionWidgets(); hide(); } ExtensionManager::~ExtensionManager() { } void ExtensionManager::restoreSettings() { mActionExtensions->setCurrentItem( KABPrefs::instance()->mCurrentExtension ); int i = 1; mCurrentExtensionWidget = mExtensionWidgetList.at( i-1 ); while ( mCurrentExtensionWidget ) { @@ -145,62 +146,62 @@ void ExtensionManager::setActiveExtension( int id ) void ExtensionManager::createExtensionWidgets() { // clear extension widget list mExtensionWidgetList.setAutoDelete( true ); QPtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList ); ExtensionWidget *wdg = 0; while ( ( wdg = wdgIt.current() ) != 0 ) mExtensionWidgetList.remove( wdg ); mExtensionWidgetList.setAutoDelete( false ); QStringList extensionNames( i18n( "None" ) ); // add addressee editor as default - QHBoxLayout *hbl = new QHBoxLayout (mWidgetBox ); + QHBoxLayout *hbl = (QHBoxLayout *) mWidgetBox->layout();; wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox ); hbl->addWidget( wdg ); //wdg->hide(); connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), SIGNAL( modified( const KABC::Addressee::List& ) ) ); mExtensionWidgetList.append( wdg ); extensionNames.append( wdg->title() ); // load the other extensions QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; #ifndef KAB_EMBEDDED KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); KTrader::OfferList::ConstIterator it; for ( it = plugins.begin(); it != plugins.end(); ++it ) { if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) continue; KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); if ( !factory ) { - kdDebug(5720) << "ExtensionManager::loadExtensions(): Factory creation failed" << endl; + //kdDebug(5720) << "ExtensionManager::loadExtensions(): Factory creation failed" << endl; continue; } ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory ); if ( !extensionFactory ) { - kdDebug(5720) << "ExtensionManager::loadExtensions(): Cast failed" << endl; + //kdDebug(5720) << "ExtensionManager::loadExtensions(): Cast failed" << endl; continue; } if ( !activeExtensions.contains( extensionFactory->identifier() ) ) continue; wdg = extensionFactory->extension( mCore, this ); if ( wdg ) { //wdg->hide(); connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), SIGNAL( modified( const KABC::Addressee::List& ) ) ); mExtensionWidgetList.append( wdg ); extensionNames.append( wdg->title() ); } } #else //KAB_EMBEDDED |