Coding style.

svn path=/trunk/KDE/kdelibs/; revision=1038339
This commit is contained in:
Adenilson Cavalcanti Da Silva 2009-10-21 05:35:56 +00:00
parent a1bf0fd085
commit 38726c368a

View File

@ -21,25 +21,18 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
#include "rotation.h" #include "rotation.h"
/* TODO:
* - revise coding style
*/
#include <QGraphicsRotation> #include <QGraphicsRotation>
namespace Plasma namespace Plasma
{ {
class RotationAnimationPrivate { class RotationAnimationPrivate {
public: public:
RotationAnimationPrivate()
{
}
~RotationAnimationPrivate() /* TODO: check if the rotation object will be deleted
{ * when the animation runs
} */
QGraphicsRotation *rotation;
QGraphicsRotation *rotation;
}; };
@ -70,54 +63,56 @@ QPropertyAnimation *RotationAnimation::render(QObject *parent)
if (axis() == Qt::XAxis) { if (axis() == Qt::XAxis) {
switch (reference()) { switch (reference()) {
case Center: case Center:
vector.setY(widgetHeight/2); vector.setY(widgetHeight/2);
break; break;
case Up: case Up:
vector.setY(0); vector.setY(0);
break; break;
case Down: case Down:
vector.setY(widgetHeight); vector.setY(widgetHeight);
break; break;
} }
} else if(axis() == Qt::YAxis) { } else if(axis() == Qt::YAxis) {
switch (reference()) { switch (reference()) {
case Center: case Center:
vector.setX(widgetWidth/2); vector.setX(widgetWidth/2);
break; break;
case Left: case Left:
vector.setX(0); vector.setX(0);
break; break;
case Right: case Right:
vector.setX(widgetWidth); vector.setX(widgetWidth);
break; break;
} }
} else if (axis() == Qt::ZAxis) { } else if (axis() == Qt::ZAxis) {
switch (reference()) { switch (reference()) {
case Center: case Center:
vector.setX(widgetWidth/2); vector.setX(widgetWidth/2);
vector.setY(widgetHeight/2); vector.setY(widgetHeight/2);
break; break;
case Center|Up: case Center|Up:
vector.setX(widgetWidth/2); vector.setX(widgetWidth/2);
vector.setY(0); vector.setY(0);
break; break;
case Center|Down: case Center|Down:
vector.setX(widgetWidth/2); vector.setX(widgetWidth/2);
vector.setY(widgetHeight); vector.setY(widgetHeight);
break; break;
case Center|Left: case Center|Left:
vector.setX(0); vector.setX(0);
vector.setY(widgetHeight/2); vector.setY(widgetHeight/2);
break; break;
case Center|Right: case Center|Right:
vector.setX(widgetWidth); vector.setX(widgetWidth);
vector.setY(widgetHeight/2); vector.setY(widgetHeight/2);
break; break;
} }
} }