[epiphany] ephy-overview-store: set the default snapshot only when failing to retrieve one



commit ea9fb4c74223c01a278e6e414c72cc4fdc089c30
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Wed Aug 29 17:42:11 2012 +0300

    ephy-overview-store: set the default snapshot only when failing to retrieve one
    
    This way there's no flashing of thumbnails between the query and the reply.

 lib/widgets/ephy-overview-store.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/lib/widgets/ephy-overview-store.c b/lib/widgets/ephy-overview-store.c
index 1ceb56b..8820737 100644
--- a/lib/widgets/ephy-overview-store.c
+++ b/lib/widgets/ephy-overview-store.c
@@ -363,7 +363,7 @@ on_snapshot_retrieved_cb (GObject *object,
                           GAsyncResult *res,
                           PeekContext *ctx)
 {
-  GtkTreeModel *model;
+  EphyOverviewStore *store;
   GtkTreePath *path;
   GtkTreeIter iter;
   GdkPixbuf *snapshot;
@@ -376,17 +376,19 @@ on_snapshot_retrieved_cb (GObject *object,
     g_error_free (error);
     error = NULL;
   } else {
-    model = gtk_tree_row_reference_get_model (ctx->ref);
+    store = EPHY_OVERVIEW_STORE (gtk_tree_row_reference_get_model (ctx->ref));
     path = gtk_tree_row_reference_get_path (ctx->ref);
-    gtk_tree_model_get_iter (model, &iter, path);
+    gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path);
     gtk_tree_path_free (path);
     if (snapshot) {
-      ephy_overview_store_set_snapshot_internal (EPHY_OVERVIEW_STORE (model),
-                                                 &iter, snapshot, ctx->timestamp);
+      ephy_overview_store_set_snapshot_internal (store, &iter, snapshot, ctx->timestamp);
       g_object_unref (snapshot);
 
+    } else {
+      ephy_overview_store_set_default_icon_internal (store, &iter,
+                                                     store->priv->default_icon);
     }
-    gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+    gtk_list_store_set (GTK_LIST_STORE (store), &iter,
                         EPHY_OVERVIEW_STORE_SNAPSHOT_CANCELLABLE, NULL,
                         -1);
   }
@@ -433,9 +435,6 @@ ephy_overview_store_peek_snapshot (EphyOverviewStore *self,
     g_object_unref (cancellable);
   }
 
-  ephy_overview_store_set_default_icon_internal (self, iter,
-                                                 self->priv->default_icon);
-
   if (url == NULL || g_strcmp0 (url, "about:blank") == 0) {
     gtk_list_store_set (GTK_LIST_STORE (self), iter,
                         EPHY_OVERVIEW_STORE_SNAPSHOT_CANCELLABLE,



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