Ignore map tile request if it is already downloading
authorSami Rämö <sami.ramo@ixonos.com>
Wed, 2 Jun 2010 06:47:36 +0000 (09:47 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Wed, 2 Jun 2010 06:47:36 +0000 (09:47 +0300)
src/map/mapfetcher.cpp

index b4ebe25..f0b4811 100644 (file)
@@ -141,7 +141,11 @@ void MapFetcher::enqueueFetchMapImage(int zoomLevel, int x, int y)
 
     QUrl url = buildURL(zoomLevel, QPoint(x, y));
 
-    /// @todo check if new request is currently downloading and ignore request
+    // ignore request if it is already downloading
+    foreach (QNetworkReply *reply, m_currentDownloads) {
+        if (reply->url() == url)
+            return;
+    }
 
     // check if new request is already in the list and move it to the begin of the list...
     bool found = false;