[Marble-commits] KDE/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Tue Oct 5 18:14:52 CEST 2010
SVN commit 1182771 by beschow:
remove MarbleMap::moveStep()
* also remove MarbleMap::move{Left, Right, Up, Down}(), which are dead code at least within the Marble project
* centralize the move step implementation in MarbleWidget
M +0 -40 MarbleMap.cpp
M +0 -23 MarbleMap.h
M +7 -3 MarbleWidget.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1182770:1182771
@@ -412,15 +412,6 @@
return d->m_model->placemarkSelectionModel();
}
-qreal MarbleMap::moveStep() const
-{
- if ( radius() < sqrt( (qreal)(width() * width() + height() * height()) ) )
- return 180.0 * 0.1;
- else
- return 180.0 * atan( (qreal)width()
- / (qreal)( 2 * radius() ) ) * 0.2;
-}
-
int MarbleMap::zoom() const
{
return d->m_logzoom;
@@ -773,37 +764,6 @@
}
-void MarbleMap::moveLeft()
-{
- int polarity = viewport()->polarity();
-
- if ( polarity < 0 )
- rotateBy( +moveStep(), 0 );
- else
- rotateBy( -moveStep(), 0 );
-}
-
-void MarbleMap::moveRight()
-{
- int polarity = viewport()->polarity();
-
- if ( polarity < 0 )
- rotateBy( -moveStep(), 0 );
- else
- rotateBy( +moveStep(), 0 );
-}
-
-
-void MarbleMap::moveUp()
-{
- rotateBy( 0, -moveStep() );
-}
-
-void MarbleMap::moveDown()
-{
- rotateBy( 0, +moveStep() );
-}
-
int MarbleMap::northPoleY()
{
return northPolePosition().y();
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.h #1182770:1182771
@@ -257,12 +257,6 @@
QItemSelectionModel *placemarkSelectionModel() const;
/**
- * @brief Return how much the map will move if one of the move slots are called.
- * @return The move step.
- */
- qreal moveStep() const;
-
- /**
* @brief Add a GeoDataPlacemark file to the model.
* @param filename the filename of the file containing the Placemarks.
*/
@@ -554,23 +548,6 @@
void setProjection( Projection projection );
/**
- * @brief Move left by the moveStep.
- */
- void moveLeft();
- /**
- * @brief Move right by the moveStep.
- */
- void moveRight();
- /**
- * @brief Move up by the moveStep.
- */
- void moveUp();
- /**
- * @brief Move down by the moveStep.
- */
- void moveDown();
-
- /**
* @brief Get the ID of the current map theme
* To ensure that a unique identifier is being used the theme does NOT
* get represented by its name but the by relative location of the file
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #1182770:1182771
@@ -243,8 +243,8 @@
void MarbleWidgetPrivate::moveByStep( MarbleWidget* widget, int stepsRight, int stepsDown, FlyToMode mode )
{
int polarity = m_map->viewport()->polarity();
- qreal left = polarity * stepsRight * m_map->moveStep();
- qreal down = stepsDown * m_map->moveStep();
+ qreal left = polarity * stepsRight * m_widget->moveStep();
+ qreal down = stepsDown * m_widget->moveStep();
widget->rotateBy( left, down, mode );
}
@@ -350,7 +350,11 @@
qreal MarbleWidget::moveStep()
{
- return d->m_map->moveStep();
+ if ( radius() < sqrt( (qreal)(width() * width() + height() * height()) ) )
+ return 180.0 * 0.1;
+ else
+ return 180.0 * atan( (qreal)width()
+ / (qreal)( 2 * radius() ) ) * 0.2;
}
int MarbleWidget::zoom() const
More information about the Marble-commits
mailing list