everytime i look in this file and scoot by these lines i think "uh oh, memory leak?" until i glance a few dozen lines further down; just stick to the idioms

svn path=/trunk/KDE/kdelibs/; revision=1063023
This commit is contained in:
Aaron J. Seigo 2009-12-16 18:41:08 +00:00
parent 9e73f45160
commit 939449050f

View File

@ -40,46 +40,40 @@ Plasma::Animation* Animator::create(Animator::Animation type, QObject *parent)
Plasma::Animation *result = 0; Plasma::Animation *result = 0;
switch (type) { switch (type) {
case FadeAnimation: case FadeAnimation:
result = new Plasma::FadeAnimation; result = new Plasma::FadeAnimation(parent);
break; break;
case GrowAnimation: case GrowAnimation:
result = new Plasma::GrowAnimation; result = new Plasma::GrowAnimation(parent);
break; break;
case PulseAnimation: case PulseAnimation:
result = new Plasma::PulseAnimation; result = new Plasma::PulseAnimation(parent);
break; break;
case RotationAnimation: case RotationAnimation:
result = new Plasma::RotationAnimation; result = new Plasma::RotationAnimation(parent);
break; break;
case RotationStackedAnimation: case RotationStackedAnimation:
result = new Plasma::RotationStackedAnimation; result = new Plasma::RotationStackedAnimation(parent);
break; break;
case SlideAnimation: case SlideAnimation:
result = new Plasma::SlideAnimation; result = new Plasma::SlideAnimation(parent);
break; break;
case GeometryAnimation: case GeometryAnimation:
result = new Plasma::GeometryAnimation; result = new Plasma::GeometryAnimation(parent);
break; break;
case ZoomAnimation: case ZoomAnimation:
result = new Plasma::ZoomAnimation; result = new Plasma::ZoomAnimation(parent);
break; break;
default: default:
kDebug() << "Unsupported animation type."; kDebug() << "Unsupported animation type.";
}
if (result) {
result->setParent(parent);
} }
return result; return result;