Finalised review and removed review comments
authorSami Rämö <sami.ramo@ixonos.com>
Mon, 19 Apr 2010 12:27:57 +0000 (15:27 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Mon, 19 Apr 2010 12:27:57 +0000 (15:27 +0300)
src/map/mapengine.cpp
src/map/mapfetcher.h
src/map/maptile.cpp
src/map/mapview.cpp
tests/map/mapscene/testmapscene.pro
tests/map/maptile/testmaptile.pro

index 2518944..f05a470 100644 (file)
@@ -201,15 +201,12 @@ void MapEngine::removeTilesOutOfView()
 {
     //qDebug() << __PRETTY_FUNCTION__;
 
-    /// @todo Jussi: convertTi.... returns QPoint DONE
     QPoint topLeft = convertTileNumberToSceneCoordinate(m_zoomLevel, m_viewGrid.topLeft());
     QPoint bottomRight = convertTileNumberToSceneCoordinate(m_zoomLevel, m_viewGrid.bottomRight()
                                                              + QPoint(1, 1));
     qreal width = bottomRight.x() - topLeft.x();
     qreal height = bottomRight.y() - topLeft.y();
 
-    /// @todo Jussi: insert comments DONE
-    //
     QList<QGraphicsItem *> viewTiles = m_mapScene->items(topLeft.x(), topLeft.y(), width, height,
                                                          Qt::ContainsItemBoundingRect);
     QList<QGraphicsItem *> allTiles = m_mapScene->items();
@@ -229,8 +226,6 @@ void MapEngine::removeStackedTiles(MapTile *newTile)
 {
     //qDebug() << __PRETTY_FUNCTION__;
 
-    /// @todo Jussi: use sceneBoundingRect DONE
-//    QRectF newTileSceneRect = newTile->mapRectToScene(newTile->boundingRect());
     QRectF newTileSceneRect = newTile->sceneBoundingRect();
     QList<QGraphicsItem *> collidingTiles = newTile->collidingItems(Qt::IntersectsItemBoundingRect);
 
@@ -302,7 +297,6 @@ void MapEngine::zoomIn()
         // remove unused tiles after zooming is done
         QTimer::singleShot(ZOOM_TIME*2, this, SLOT(removeTilesOutOfView()));
     }
-        /// @todo DONE: Sami: return only to end
 }
 
 void MapEngine::zoomOut()
@@ -317,7 +311,6 @@ void MapEngine::zoomOut()
 
         getTiles(m_sceneCoordinate);
     }
-    /// @todo DONE: Sami: return
 }
 
 void MapEngine::setTilesDrawingLevels()
@@ -346,6 +339,7 @@ QString MapEngine::tilePath(int zoomLevel, int x, int y)
 void MapEngine::scalingFactorChanged(qreal scaleFactor)
 {
     qDebug() << __PRETTY_FUNCTION__;
+    Q_UNUSED(scaleFactor);
 }
 
 QPoint MapEngine::convertSceneCoordinateToTileNumber(int zoomLevel, QPoint sceneCoordinate)
index 81571da..dbfef0d 100644 (file)
@@ -112,8 +112,8 @@ signals:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    static const int MAX_PARALLEL_DOWNLOADS = 2;
-    static const int DOWNLOAD_QUEUE_SIZE = 50;
+    static const int MAX_PARALLEL_DOWNLOADS = 2; ///< Max simultaneous parallel downloads
+    static const int DOWNLOAD_QUEUE_SIZE = 50; ///< Max downloads waiting in queue
 
     QList<QNetworkReply*> m_currentDownloads; ///< List of current downloads
     QQueue<QUrl> m_downloadQueue;             ///< Queue of pending requests
index cc68743..0bae905 100644 (file)
@@ -51,7 +51,6 @@ void MapTile::setZoomLevel(int zoomLevel)
 
 void MapTile::setSceneLevel(int currentZoomLevel)
 {
-    /// @todo DONE Sami: bbb
     if (currentZoomLevel < m_zoomLevel) {
         qreal z = static_cast<qreal>(MIN_MAP_SCENE_NORMAL_LEVEL + currentZoomLevel
                                      - (m_zoomLevel - currentZoomLevel)) + 0.5;
@@ -81,11 +80,11 @@ void MapTile::setPosition()
     const int maxTileNumber = (1 << m_zoomLevel) - 1;
 
     if ((m_zoomLevel >= MIN_MAP_ZOOM_LEVEL) && (m_zoomLevel <= MAX_MAP_ZOOM_LEVEL) &&
-            (m_tileNumber.x() >= 0) && (m_tileNumber.x() <= maxTileNumber) &&
-            (m_tileNumber.y() >= 0) && (m_tileNumber.y() <= maxTileNumber)) {
+        (m_tileNumber.x() >= 0) && (m_tileNumber.x() <= maxTileNumber) &&
+        (m_tileNumber.y() >= 0) && (m_tileNumber.y() <= maxTileNumber)) {
+
         setPos(MapEngine::convertTileNumberToSceneCoordinate(m_zoomLevel, m_tileNumber));
         //qDebug() << __PRETTY_FUNCTION__ << "tile position:" << pos();
-        /// @todo DONE Sami: return
     }
     else {
         setPos(UNDEFINED, UNDEFINED);
index 6ecc2b9..cf8c27c 100644 (file)
@@ -51,7 +51,7 @@ void MapView::setZoomLevel(int zoomLevel)
 {
     m_zoomTargetScale = pow(2, zoomLevel - MAX_MAP_ZOOM_LEVEL);
     m_zoomScaleDelta = (m_zoomTargetScale - currentScale()) / (ZOOM_FPS * (ZOOM_TIME / 1000));
-/// @todo DONE Sami: starts new timer
+
     if (m_timerID)
         killTimer(m_timerID);
 
index 4c5bd24..0058538 100644 (file)
@@ -12,6 +12,10 @@ INCLUDEPATH += . \
 # Input
 SOURCES += testmapscene.cpp \
     ../../../src/map/mapscene.cpp \
-    ../../../src/map/maptile.cpp
+    ../../../src/map/maptile.cpp \
+    ../../../src/map/mapengine.cpp \
+    ../../../src/map/mapfetcher.cpp
 HEADERS += ../../../src/map/mapscene.h \
-    ../../../src/map/maptile.h
+    ../../../src/map/maptile.h \
+    ../../../src/map/mapengine.h \
+    ../../../src/map/mapfetcher.h
index 8526f70..5b54264 100644 (file)
@@ -11,5 +11,11 @@ INCLUDEPATH += . \
 
 # Input
 SOURCES += testmaptile.cpp \
-    ../../../src/map/maptile.cpp
-HEADERS += ../../../src/map/maptile.h
+    ../../../src/map/maptile.cpp \
+    ../../../src/map/mapfetcher.cpp \
+    ../../../src/map/mapengine.cpp \
+    ../../../src/map/mapscene.cpp
+HEADERS += ../../../src/map/maptile.h \
+    ../../../src/map/mapfetcher.h \
+    ../../../src/map/mapengine.h \
+    ../../../src/map/mapscene.h