Commit b7f0b98e authored by Matthias Kretz's avatar Matthias Kretz
Browse files

don't crash; this code was expecting too much

svn path=/trunk/KDE/kdebase/apps/; revision=706274
parent a6659863
...@@ -53,7 +53,8 @@ K_EXPORT_PLUGIN(KURIFactory("kcmkurifilt")) ...@@ -53,7 +53,8 @@ K_EXPORT_PLUGIN(KURIFactory("kcmkurifilt"))
class FilterOptions; class FilterOptions;
KURIFilterModule::KURIFilterModule(QWidget *parent, const QVariantList &) KURIFilterModule::KURIFilterModule(QWidget *parent, const QVariantList &)
:KCModule(KURIFactory::componentData(), parent) : KCModule(KURIFactory::componentData(), parent),
m_widget(0)
{ {
filter = KUriFilter::self(); filter = KUriFilter::self();
...@@ -84,14 +85,15 @@ KURIFilterModule::KURIFilterModule(QWidget *parent, const QVariantList &) ...@@ -84,14 +85,15 @@ KURIFilterModule::KURIFilterModule(QWidget *parent, const QVariantList &)
for (; it != end; ++it ) for (; it != end; ++it )
{ {
KUriFilterPlugin *plugin = KService::createInstance<KUriFilterPlugin>( *it ); KUriFilterPlugin *plugin = KService::createInstance<KUriFilterPlugin>( *it );
if (plugin) {
KCModule *module = plugin->configModule(this, 0); KCModule *module = plugin->configModule(this, 0);
if (module) if (module) {
{
modules.append(module); modules.append(module);
helper.insert(plugin->configName(), module); helper.insert(plugin->configName(), module);
connect(module, SIGNAL(changed(bool)), SIGNAL(changed(bool))); connect(module, SIGNAL(changed(bool)), SIGNAL(changed(bool)));
} }
} }
}
if (modules.count() > 1) if (modules.count() > 1)
{ {
...@@ -104,16 +106,18 @@ KURIFilterModule::KURIFilterModule(QWidget *parent, const QVariantList &) ...@@ -104,16 +106,18 @@ KURIFilterModule::KURIFilterModule(QWidget *parent, const QVariantList &)
} }
tab->showPage(modules.first()); tab->showPage(modules.first());
widget = tab; m_widget = tab;
} }
else if (modules.count() == 1) else if (modules.count() == 1)
{ {
widget = modules.first(); m_widget = modules.first();
// Huh? A negative margin? // Huh? A negative margin?
// layout->setMargin(-KDialog::marginHint()); // layout->setMargin(-KDialog::marginHint());
} }
layout->addWidget(widget); if (m_widget) {
layout->addWidget(m_widget);
}
} }
void KURIFilterModule::load() void KURIFilterModule::load()
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
private: private:
KUriFilter *filter; KUriFilter *filter;
QWidget *widget; QWidget *m_widget;
FilterOptions *opts; FilterOptions *opts;
QList<KCModule *> modules; QList<KCModule *> modules;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment