Hypothetically, if you run through the conditions on the if, there's an implicit third branch that isn't matched,

corresponding to the first but with the != changed to a ==.  Of course, in practice, I can't see why this would /ever/ 
happen, but the compiler picked up on it.  Hence, to shut the damned thing up and in case I'm wrong, the pointer is 
now initialised to zero and a Q_ASSERT used to make sure it isn't zero at the point where we try to use it.  Quiet 
compiler, and a modicum more robustness.


svn path=/trunk/KDE/kdelibs/; revision=957515
This commit is contained in:
Andrew Coles 2009-04-22 10:11:01 +00:00
parent 8a4ce887ea
commit c54617a1bd

View File

@ -285,7 +285,7 @@ void VideoWidget::setUsedControls(const Controls controls)
//kDebug()<<"Setting used controls"<<controls;
QGraphicsLinearLayout *controlsLayout;
QGraphicsLinearLayout *controlsLayout = 0;
if (controls != NoControls && d->controlsWidget == 0) {
d->controlsWidget = new Plasma::Frame(this);
d->controlsWidget->setFrameShadow(Plasma::Frame::Raised);
@ -306,6 +306,8 @@ void VideoWidget::setUsedControls(const Controls controls)
return;
}
Q_ASSERT(controlsLayout);
//empty the layout
while (controlsLayout->count() > 0) {
controlsLayout->removeAt(0);