diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2012-08-29 22:42:11 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2012-09-01 02:34:02 +0800 |
commit | ea9fb4c74223c01a278e6e414c72cc4fdc089c30 (patch) | |
tree | 95241c785f3e7ee8aebc71e729de9a8650ff0c40 /lib | |
parent | a24c76b3eadb61b1964d6a7e1164c6a9bcf247e2 (diff) | |
download | gsoc2013-epiphany-ea9fb4c74223c01a278e6e414c72cc4fdc089c30.tar gsoc2013-epiphany-ea9fb4c74223c01a278e6e414c72cc4fdc089c30.tar.gz gsoc2013-epiphany-ea9fb4c74223c01a278e6e414c72cc4fdc089c30.tar.bz2 gsoc2013-epiphany-ea9fb4c74223c01a278e6e414c72cc4fdc089c30.tar.lz gsoc2013-epiphany-ea9fb4c74223c01a278e6e414c72cc4fdc089c30.tar.xz gsoc2013-epiphany-ea9fb4c74223c01a278e6e414c72cc4fdc089c30.tar.zst gsoc2013-epiphany-ea9fb4c74223c01a278e6e414c72cc4fdc089c30.zip |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | 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 1ceb56b2b..882073786 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, |