[libchamplain] Fix error tile always showing up when no network connectivity



commit e65e3eca6f2b830fc7b73b58a09f1689ca999b1b
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date:   Tue Jun 9 10:08:11 2009 -0400

    Fix error tile always showing up when no network connectivity
---
 champlain/champlain-network-map-source.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/champlain/champlain-network-map-source.c b/champlain/champlain-network-map-source.c
index 277ff07..994f269 100644
--- a/champlain/champlain-network-map-source.c
+++ b/champlain/champlain-network-map-source.c
@@ -456,7 +456,9 @@ file_loaded_cb (SoupSession *session,
           champlain_tile_get_x (tile),
           champlain_tile_get_y (tile),
           soup_status_get_phrase (msg->status_code));
-      create_error_tile (tile);
+
+      if (champlain_tile_get_state (tile) != CHAMPLAIN_STATE_VALIDATING_CACHE)
+        create_error_tile (tile);
       goto finish;
     }
 
@@ -530,7 +532,6 @@ file_loaded_cb (SoupSession *session,
       gdk_pixbuf_get_n_channels (pixbuf) / 8,
       0, &error))
     {
-      g_print ("BPP: %d", gdk_pixbuf_get_bits_per_sample (pixbuf));
       if (error)
         {
           g_warning ("Unable to transfer to clutter: %s", error->message);
@@ -609,7 +610,9 @@ fill_tile (ChamplainMapSource *map_source,
                champlain_tile_get_x (tile), champlain_tile_get_y (tile),
                zoom_level);
       champlain_tile_set_uri (tile, uri);
-      champlain_tile_set_state (tile, CHAMPLAIN_STATE_LOADING);
+
+      if (champlain_tile_get_state (tile) != CHAMPLAIN_STATE_VALIDATING_CACHE)
+        champlain_tile_set_state (tile, CHAMPLAIN_STATE_LOADING);
       msg = soup_message_new (SOUP_METHOD_GET, uri);
 
       if (in_cache == TRUE)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]