Fix crash at plasma startup.

The toolbox has to be initialized before any call to setCollapsed. (because the resize event uses it)


svn path=/trunk/KDE/kdelibs/; revision=913616
This commit is contained in:
Olivier Goffart 2009-01-19 16:03:20 +00:00
parent 307f5760c3
commit 7bd898f55e

View File

@ -95,6 +95,12 @@ ExtenderItem::ExtenderItem(Extender *hostExtender, uint extenderItemId)
d->extenderItemId = ++ExtenderItemPrivate::s_maxExtenderItemId; d->extenderItemId = ++ExtenderItemPrivate::s_maxExtenderItemId;
} }
//create the toolbox.
d->toolbox = new QGraphicsWidget(this);
d->toolboxLayout = new QGraphicsLinearLayout(d->toolbox);
d->toolbox->setLayout(d->toolboxLayout);
//create items's configgroup //create items's configgroup
KConfigGroup cg = hostExtender->d->applet->config("ExtenderItems"); KConfigGroup cg = hostExtender->d->applet->config("ExtenderItems");
KConfigGroup dg = KConfigGroup(&cg, QString::number(d->extenderItemId)); KConfigGroup dg = KConfigGroup(&cg, QString::number(d->extenderItemId));
@ -138,11 +144,6 @@ ExtenderItem::ExtenderItem(Extender *hostExtender, uint extenderItemId)
connect(d->sourceApplet, SIGNAL(destroyed()), this, SLOT(sourceAppletRemoved())); connect(d->sourceApplet, SIGNAL(destroyed()), this, SLOT(sourceAppletRemoved()));
connect(d->collapseIcon, SIGNAL(clicked()), this, SLOT(toggleCollapse())); connect(d->collapseIcon, SIGNAL(clicked()), this, SLOT(toggleCollapse()));
//create the toolbox.
d->toolbox = new QGraphicsWidget(this);
d->toolboxLayout = new QGraphicsLinearLayout(d->toolbox);
d->toolbox->setLayout(d->toolboxLayout);
//set the extender we want to move to. //set the extender we want to move to.
setExtender(hostExtender); setExtender(hostExtender);