SVN commit 1191704 by majewsky: Simplify moveableItems() implementations and some unnecessarily complicated calculations. M +4 -9 floater.cpp M +1 -1 floater.h M +4 -13 game.cpp M +1 -3 slope.cpp --- trunk/KDE/kdegames/kolf/floater.cpp #1191703:1191704 @@ -133,25 +133,20 @@ void Floater::reset() { - QPointF startf = wall->startPoint() + QPointF(wall->x(), wall->y()); - QPointF endf = wall->endPoint() + QPointF(wall->x(), wall->y()); - QPoint start = (QPoint((int)startf.x(), (int)startf.y())); - QPoint end = (QPoint((int)endf.x(), (int)endf.y())); + QPointF start = wall->startPointF() + QPointF(wall->x(), wall->y()); + QPointF end = wall->endPointF() + QPointF(wall->x(), wall->y()); vector = end - start; origin = end; - setPos(origin.x(), origin.y()); + setPos(origin); moveBy(0, 0); setSpeed(speed); } QList Floater::moveableItems() const { - QList ret(wall->moveableItems()); - ret.append(wall); - ret.append(point); - return ret; + return wall->moveableItems() << wall << point; } void Floater::aboutToDie() --- trunk/KDE/kdegames/kolf/floater.h #1191703:1191704 @@ -88,7 +88,7 @@ int speed; FloaterGuide *wall; - QPoint origin; + QPointF origin; Vector vector; bool noUpdateZ; bool haventMoved; --- trunk/KDE/kdegames/kolf/game.cpp #1191703:1191704 @@ -399,9 +399,7 @@ QList Bridge::moveableItems() const { - QList ret; - ret.append(point); - return ret; + return QList() << point; } void Bridge::setSize(const QSizeF& size) @@ -782,9 +780,7 @@ QList KolfEllipse::moveableItems() const { - QList ret; - ret.append(point); - return ret; + return QList() << point; } void KolfEllipse::moveBy(double dx, double dy) @@ -1224,9 +1220,7 @@ QList BlackHole::moveableItems() const { - QList ret; - ret.append(exitItem); - return ret; + return QList() << exitItem; } bool BlackHole::collision(Ball *ball, long int /*id*/) @@ -1780,10 +1774,7 @@ QList Wall::moveableItems() const { - QList ret; - ret.append(startItem); - ret.append(endItem); - return ret; + return QList() << startItem << endItem; } void Wall::moveBy(double dx, double dy) --- trunk/KDE/kdegames/kolf/slope.cpp #1191703:1191704 @@ -115,9 +115,7 @@ QList Slope::moveableItems() const { - QList ret; - ret.append(point); - return ret; + return QList() << point; } void Slope::setGrade(double newGrade)