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 | |||
@@ -53,16 +53,17 @@ ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent, | |||
53 | mCore->actionCollection(), | 53 | mCore->actionCollection(), |
54 | "options_show_extensions" ); | 54 | "options_show_extensions" ); |
55 | 55 | ||
56 | mActionExtensions->plug( settingsmenu ); | 56 | mActionExtensions->plug( settingsmenu ); |
57 | 57 | ||
58 | connect( mActionExtensions, SIGNAL( activated( int ) ), | 58 | connect( mActionExtensions, SIGNAL( activated( int ) ), |
59 | SLOT( setActiveExtension( int ) ) ); | 59 | SLOT( setActiveExtension( int ) ) ); |
60 | mWidgetBox = new QWidget( viewport() ); | 60 | mWidgetBox = new QWidget( viewport() ); |
61 | new QHBoxLayout (mWidgetBox ); | ||
61 | addChild( mWidgetBox ); | 62 | addChild( mWidgetBox ); |
62 | setResizePolicy(AutoOneFit); | 63 | setResizePolicy(AutoOneFit); |
63 | createExtensionWidgets(); | 64 | createExtensionWidgets(); |
64 | hide(); | 65 | hide(); |
65 | } | 66 | } |
66 | 67 | ||
67 | ExtensionManager::~ExtensionManager() | 68 | ExtensionManager::~ExtensionManager() |
68 | { | 69 | { |
@@ -153,17 +154,17 @@ void ExtensionManager::createExtensionWidgets() | |||
153 | mExtensionWidgetList.remove( wdg ); | 154 | mExtensionWidgetList.remove( wdg ); |
154 | 155 | ||
155 | mExtensionWidgetList.setAutoDelete( false ); | 156 | mExtensionWidgetList.setAutoDelete( false ); |
156 | 157 | ||
157 | QStringList extensionNames( i18n( "None" ) ); | 158 | QStringList extensionNames( i18n( "None" ) ); |
158 | 159 | ||
159 | // add addressee editor as default | 160 | // add addressee editor as default |
160 | 161 | ||
161 | QHBoxLayout *hbl = new QHBoxLayout (mWidgetBox ); | 162 | QHBoxLayout *hbl = (QHBoxLayout *) mWidgetBox->layout();; |
162 | 163 | ||
163 | wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox ); | 164 | wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox ); |
164 | hbl->addWidget( wdg ); | 165 | hbl->addWidget( wdg ); |
165 | //wdg->hide(); | 166 | //wdg->hide(); |
166 | connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), | 167 | connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), |
167 | SIGNAL( modified( const KABC::Addressee::List& ) ) ); | 168 | SIGNAL( modified( const KABC::Addressee::List& ) ) ); |
168 | mExtensionWidgetList.append( wdg ); | 169 | mExtensionWidgetList.append( wdg ); |
169 | extensionNames.append( wdg->title() ); | 170 | extensionNames.append( wdg->title() ); |
@@ -175,24 +176,24 @@ void ExtensionManager::createExtensionWidgets() | |||
175 | KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); | 176 | KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); |
176 | KTrader::OfferList::ConstIterator it; | 177 | KTrader::OfferList::ConstIterator it; |
177 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { | 178 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { |
178 | if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) | 179 | if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) |
179 | continue; | 180 | continue; |
180 | 181 | ||
181 | KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); | 182 | KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); |
182 | if ( !factory ) { | 183 | if ( !factory ) { |
183 | kdDebug(5720) << "ExtensionManager::loadExtensions(): Factory creation failed" << endl; | 184 | //kdDebug(5720) << "ExtensionManager::loadExtensions(): Factory creation failed" << endl; |
184 | continue; | 185 | continue; |
185 | } | 186 | } |
186 | 187 | ||
187 | ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory ); | 188 | ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory ); |
188 | 189 | ||
189 | if ( !extensionFactory ) { | 190 | if ( !extensionFactory ) { |
190 | kdDebug(5720) << "ExtensionManager::loadExtensions(): Cast failed" << endl; | 191 | //kdDebug(5720) << "ExtensionManager::loadExtensions(): Cast failed" << endl; |
191 | continue; | 192 | continue; |
192 | } | 193 | } |
193 | 194 | ||
194 | if ( !activeExtensions.contains( extensionFactory->identifier() ) ) | 195 | if ( !activeExtensions.contains( extensionFactory->identifier() ) ) |
195 | continue; | 196 | continue; |
196 | 197 | ||
197 | wdg = extensionFactory->extension( mCore, this ); | 198 | wdg = extensionFactory->extension( mCore, this ); |
198 | if ( wdg ) { | 199 | if ( wdg ) { |