Removed debug messages from MapEngine.
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Thu, 15 Apr 2010 13:48:11 +0000 (16:48 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Thu, 15 Apr 2010 13:48:11 +0000 (16:48 +0300)
src/map/mapengine.cpp
src/map/mapfetcher.cpp
src/src.pro

index 6b607aa..4f9b586 100644 (file)
@@ -100,7 +100,7 @@ void MapEngine::mapImageReceived(const QUrl &url, const QPixmap &pixmap)
 {
     //qDebug() << __PRETTY_FUNCTION__;
 
-    if (mapTilesInScene.contains(url.toString())) {
+    //if (mapTilesInScene.contains(url.toString())) {
         int zoom = -1;
         int x = -1;
         int y = -1;
@@ -117,8 +117,9 @@ void MapEngine::mapImageReceived(const QUrl &url, const QPixmap &pixmap)
 
         removeStackedTiles(mapTile);
 
-        //qDebug() << "Tile count: " << m_mapScene->items().count();
-   }
+//        qDebug() << "MapScene count: " << m_mapScene->items().count();
+//        qDebug() << "Hash count    : " << mapTilesInScene.count();
+   //}
 }
 
 QGraphicsScene* MapEngine::scene()
@@ -221,7 +222,7 @@ void MapEngine::removeOldTiles()
 
      while (i.hasNext()) {
          i.next();
-         if (allTiles.contains(i.value())) {
+         if (allTiles.contains(i.value()) && mapTilesInScene.contains(i.key())) {
              MapTile *tile = i.value();
              if (tile) {
                  mapTilesInScene.remove(i.key());
@@ -268,8 +269,6 @@ void MapEngine::zoomIn()
     emit zoomLevelChanged(m_zoomLevel);
 
     setZValues();
-    calculateNewTiles(m_sceneCoordinate);
-    removeOldTiles();
 }
 
 void MapEngine::zoomOut()
@@ -283,8 +282,6 @@ void MapEngine::zoomOut()
     emit zoomLevelChanged(m_zoomLevel);
 
     setZValues();
-    calculateNewTiles(m_sceneCoordinate);
-    removeOldTiles();
 }
 
 void MapEngine::setZValues()
index ee392c2..bf3a49f 100644 (file)
@@ -111,8 +111,10 @@ void MapFetcher::downloadFinished(QNetworkReply *reply)
         QImage image;
         QUrl url = reply->url();
 
-        if (!image.load(reply, 0))
+        if (!image.load(reply, 0)) {
+            qDebug() << "Could not load image";
             image = QImage();
+        }
 
         emit mapImageReceived(url, QPixmap::fromImage(image));
     }
index 1e08da3..4068f33 100644 (file)
@@ -53,3 +53,4 @@ unix {
     target.path = $$BINDIR
     INSTALLS += target
 }
+RESOURCES +=