Only call into the larger framework when we're fully initialized; the framework called back into ItemBackground when member variables were not initialized, causing valgrind warnings.

svn path=/trunk/KDE/kdelibs/; revision=1171385
This commit is contained in:
Andreas Hartmetz 2010-09-03 16:39:37 +00:00
parent 99b57b9c65
commit baa2c64f61

View File

@ -62,13 +62,6 @@ ItemBackground::ItemBackground(QGraphicsWidget *parent)
: QGraphicsWidget(parent),
d(new ItemBackgroundPrivate(this))
{
setCacheMode(DeviceCoordinateCache);
setFlag(ItemIsMovable, false);
setFlag(ItemIsSelectable, false);
setFlag(ItemIsFocusable, false);
setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
d->frameSvg = new Plasma::FrameSvg(this);
d->anim = new QPropertyAnimation(this, "animationUpdate", this);
d->anim->setStartValue(0);
@ -83,6 +76,13 @@ ItemBackground::ItemBackground(QGraphicsWidget *parent)
d->frameSvg->setCacheAllRenderedFrames(true);
d->frameSvg->setElementPrefix("hover");
setCacheMode(DeviceCoordinateCache);
setFlag(ItemIsMovable, false);
setFlag(ItemIsSelectable, false);
setFlag(ItemIsFocusable, false);
setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
qreal l, t, r, b;
d->frameSvg->getMargins(l, t, r, b);
setContentsMargins(l, t, r, b);