From a2561e016bbe5797120949cc216fcb73016b39fd Mon Sep 17 00:00:00 2001 From: Ville Tiensuu Date: Mon, 17 May 2010 15:15:23 +0300 Subject: [PATCH] added comments --- src/engine/engine.cpp | 3 +-- src/map/mapengine.cpp | 9 ++++----- src/map/mapengine.h | 10 ++++++++-- src/map/mapview.cpp | 1 + src/ui/mapviewscreen.cpp | 9 ++------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index f6ce461..6cfa817 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -244,7 +244,6 @@ void SituareEngine::enableAutoCentering(bool enabled) void SituareEngine::receiveOwnLocation(QPointF ownLocation) { - qWarning() << __PRETTY_FUNCTION__; - qWarning() << ownLocation.x() << " " << ownLocation.y(); + qDebug() << __PRETTY_FUNCTION__; m_latestLocation = ownLocation; } diff --git a/src/map/mapengine.cpp b/src/map/mapengine.cpp index 77c9a00..e11b8d7 100644 --- a/src/map/mapengine.cpp +++ b/src/map/mapengine.cpp @@ -362,8 +362,7 @@ void MapEngine::setAutoCentering(bool enabled) } QPointF MapEngine::convertSceneCoordinateToLatLon(int zoomLevel, QPoint sceneCoordinate) -{ - qWarning() << __PRETTY_FUNCTION__; +{ qDebug() << __PRETTY_FUNCTION__; double tileFactor = 1 << (MAX_MAP_ZOOM_LEVEL - zoomLevel); @@ -385,8 +384,7 @@ QPointF MapEngine::ownLocation() emit requestToGetViewPortContents(); QPointF ownLatitudeLongitudeLocation = - convertSceneCoordinateToLatLon(m_zoomLevel, m_viewArea.center()); - qWarning() << ownLatitudeLongitudeLocation.x() << " " << ownLatitudeLongitudeLocation.y(); + convertSceneCoordinateToLatLon(m_zoomLevel, m_viewArea.center()); emit ownLocation(ownLatitudeLongitudeLocation); return ownLatitudeLongitudeLocation; @@ -394,7 +392,8 @@ QPointF MapEngine::ownLocation() QRect MapEngine::receiveViewSceneRect(QRect viewSceneRect) { - qWarning() << __PRETTY_FUNCTION__; + qDebug() << __PRETTY_FUNCTION__; + m_viewArea = viewSceneRect; return m_viewArea; } diff --git a/src/map/mapengine.h b/src/map/mapengine.h index 62efaaa..604e824 100644 --- a/src/map/mapengine.h +++ b/src/map/mapengine.h @@ -161,14 +161,20 @@ public slots: */ void receiveOwnLocation(User *user); -/** + /** * @brief Returns own location crosshair's latitude and longitude coordinates * * @return own location */ QPointF ownLocation(); -QRect receiveViewSceneRect(QRect viewSceneRect); + /** + * @brief Slot to receive visible area of map scene + * + * @ + * @return visible area of map scene + */ + QRect receiveViewSceneRect(QRect viewSceneRect); private: /** diff --git a/src/map/mapview.cpp b/src/map/mapview.cpp index 5f47507..f099331 100644 --- a/src/map/mapview.cpp +++ b/src/map/mapview.cpp @@ -134,3 +134,4 @@ QRect MapView::viewportContent() return QRect(topLeft, bottomRight); } + diff --git a/src/ui/mapviewscreen.cpp b/src/ui/mapviewscreen.cpp index 3fdcca9..d4aa294 100644 --- a/src/ui/mapviewscreen.cpp +++ b/src/ui/mapviewscreen.cpp @@ -101,7 +101,7 @@ MapViewScreen::MapViewScreen(QWidget *parent) connect(m_mapEngine, SIGNAL(requestToGetViewPortContents()), mapView, SLOT(viewportContent())); - connect(mapView, SIGNAL(viewContentChanged(QRect)), + connect(mapView, SIGNAL(updateViewContent(QRect)), m_mapEngine, SLOT(receiveViewSceneRect(QRect))); connect(this, SIGNAL(requestOwnLocation()), m_mapEngine, SLOT(ownLocation())); @@ -168,17 +168,12 @@ void MapViewScreen::enableAutoCentering(bool enabled) void MapViewScreen::drawOwnLocationCrosshair(int width, int height) { - qWarning() << __PRETTY_FUNCTION__; - qWarning() << "widht: " << width << "height: " << height; + qDebug() << __PRETTY_FUNCTION__; if (m_drawOwnLocationCrosshair) { ownLocationCrosshair->move(width/2 - ownLocationCrosshair->pixmap()->width()/2, height/2 - ownLocationCrosshair->pixmap()->height()/2); } - - qWarning() << "ownLocation test: " << m_mapEngine->ownLocation().x() - << m_mapEngine->ownLocation().y(); - } void MapViewScreen::setOwnLocationCrosshairVisibility(bool visibility) -- 1.7.9.5