[Marble-commits] KDE/kdeedu/marble/src/lib

Jens-Michael Hoffmann jensmh at gmx.de
Thu May 6 18:07:02 CEST 2010


SVN commit 1123682 by jmhoffmann:

Coding style: Pass POD arguments by value, non POD arguments by reference to const instead.

 M  +2 -2      MarbleMap.cpp  
 M  +5 -5      MarbleMap.h  
 M  +5 -5      MarbleWidget.cpp  
 M  +7 -7      MarbleWidget.h  


--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1123681:1123682
@@ -408,7 +408,7 @@
     d->doResize();
 }
 
-void MarbleMap::setSize( QSize size )
+void MarbleMap::setSize( const QSize& size )
 {
     d->m_width  = size.width();
     d->m_height = size.height();
@@ -785,7 +785,7 @@
 }
 
 
-void MarbleMap::centerOn( const qreal& lon, const qreal& lat )
+void MarbleMap::centerOn( const qreal lon, const qreal lat )
 {
     Quaternion  quat;
     quat.createFromEuler( -lat * DEG2RAD, lon * DEG2RAD, 0.0 );
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.h #1123681:1123682
@@ -129,7 +129,7 @@
     MeasureTool  *measureTool();
 
     void  setSize( int width, int height );
-    void  setSize( QSize size );
+    void  setSize( const QSize& size );
     QSize size()   const;
     int   width()  const;
     int   height() const;
@@ -509,7 +509,7 @@
      * @param  lon  an angle parallel to the longitude lines
      *              +180(W) - -180(E)
      */
-    void  centerOn( const qreal &lon, const qreal &lat );
+    void  centerOn( const qreal lon, const qreal lat );
 
     /**
      * @brief  Center the view on a point
@@ -817,11 +817,11 @@
      * @brief Signal that the theme has changed
      * @param theme  Name of the new theme.
      */
-    void  themeChanged( QString theme );
+    void  themeChanged( const QString& theme );
 
     void  projectionChanged( Projection );
 
-    void  mouseMoveGeoPosition( QString );
+    void  mouseMoveGeoPosition( const QString& );
 
     void  mouseClickGeoPosition( qreal lon, qreal lat, GeoDataCoordinates::Unit );
 
@@ -832,7 +832,7 @@
      * If available with the @p dirtyRegion which is the region the view will change in.
      * If dirtyRegion.isEmpty() returns true, the whole viewport has to be repainted.
      */
-    void repaintNeeded( QRegion dirtyRegion );
+    void repaintNeeded( const QRegion& dirtyRegion );
 
  protected:
 
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #1123681:1123682
@@ -570,7 +570,7 @@
     d->repaint();
 }
 
-void MarbleWidget::rotateBy( const qreal& deltaLon, const qreal& deltaLat, FlyToMode mode )
+void MarbleWidget::rotateBy( const qreal deltaLon, const qreal deltaLat, FlyToMode mode )
 {
     Quaternion  rotPhi( 1.0, deltaLat / 180.0, 0.0, 0.0 );
     Quaternion  rotTheta( 1.0, 0.0, deltaLon / 180.0, 0.0 );
@@ -591,7 +591,7 @@
 }
 
 
-void MarbleWidget::centerOn( const qreal& lon, const qreal& lat, bool animated )
+void MarbleWidget::centerOn( const qreal lon, const qreal lat, bool animated )
 {
     GeoDataCoordinates target( lon, lat, 0.0, GeoDataCoordinates::Degree );
     centerOn( target, animated );
@@ -765,12 +765,12 @@
     return d->m_map->centerLongitude();
 }
 
-const QRegion MarbleWidget::activeRegion()
+QRegion MarbleWidget::activeRegion()
 {
     return d->m_map->viewParams()->viewport()->activeRegion();
 }
 
-const QRegion MarbleWidget::mapRegion()
+QRegion MarbleWidget::mapRegion()
 {
     return d->m_map->viewParams()->currentProjection()->mapRegion( d->m_map->viewParams()->viewport() );
 }
@@ -1129,7 +1129,7 @@
     update();
 }
 
-void MarbleWidget::scheduleRepaint( QRegion dirtyRegion )
+void MarbleWidget::scheduleRepaint( const QRegion& dirtyRegion )
 {
     Q_UNUSED( dirtyRegion );
     if ( !d->m_repaintTimer.isActive() ) {
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.h #1123681:1123682
@@ -190,12 +190,12 @@
     /**
      * @brief Return the active region in which it's possible to drag the view using the mouse.
      */
-    const QRegion  activeRegion();
+    QRegion  activeRegion();
 
     /**
      * @brief Return the projected region which describes the (shape of the) projected surface.
      */
-    const QRegion  mapRegion();
+    QRegion  mapRegion();
 
     /**
      * @brief  Return the radius of the globe in pixels.
@@ -597,7 +597,7 @@
      * of (lon, lat), otherwise the resulting angle will be the sum of
      * the previous position and the two offsets.
      */
-    void  rotateBy( const qreal &deltaLon, const qreal &deltaLat, FlyToMode mode = Instant );
+    void  rotateBy( const qreal deltaLon, const qreal deltaLat, FlyToMode mode = Instant );
 
     /**
      * @brief  Rotate the view by the angle specified by a Quaternion.
@@ -612,7 +612,7 @@
      * @param  lon  an angle in degrees parallel to the longitude lines
      *              +180(W) - -180(E)
      */
-    void  centerOn( const qreal &lon, const qreal &lat, bool animated = false );
+    void  centerOn( const qreal lon, const qreal lat, bool animated = false );
 
     /**
      * @brief  Center the view on a point
@@ -910,7 +910,7 @@
     /**
      * Schedule repaint
      */
-    void scheduleRepaint( QRegion dirtyRegion );
+    void scheduleRepaint( const QRegion& dirtyRegion );
 
     /**
      * @brief Set the map quality depending on the view context 
@@ -958,11 +958,11 @@
      * @brief Signal that the theme has changed
      * @param theme  Name of the new theme.
      */
-    void  themeChanged( QString theme );
+    void  themeChanged( const QString& theme );
 
     void  projectionChanged( Projection );
 
-    void  mouseMoveGeoPosition( QString );
+    void  mouseMoveGeoPosition( const QString& );
 
     void  mouseClickGeoPosition( qreal lon, qreal lat, GeoDataCoordinates::Unit );
 


More information about the Marble-commits mailing list