aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-08-29 22:40:23 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-09-01 02:34:02 +0800
commita24c76b3eadb61b1964d6a7e1164c6a9bcf247e2 (patch)
tree2758a6fc551e83d8a3ed7cfe2455806d5acbeb9b
parentad274ecde055542fb8b867f7ff4247f5f2188c16 (diff)
downloadgsoc2013-epiphany-a24c76b3eadb61b1964d6a7e1164c6a9bcf247e2.tar.gz
gsoc2013-epiphany-a24c76b3eadb61b1964d6a7e1164c6a9bcf247e2.tar.zst
gsoc2013-epiphany-a24c76b3eadb61b1964d6a7e1164c6a9bcf247e2.zip
ephy-overview-store: add internal helper for setting the default icon
Just to spare some code repetition.
-rw-r--r--lib/widgets/ephy-overview-store.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/widgets/ephy-overview-store.c b/lib/widgets/ephy-overview-store.c
index c5e1e2a5c..1ceb56b2b 100644
--- a/lib/widgets/ephy-overview-store.c
+++ b/lib/widgets/ephy-overview-store.c
@@ -345,6 +345,19 @@ ephy_overview_store_set_snapshot (EphyOverviewStore *store,
g_object_unref (pixbuf);
}
+
+static void
+ephy_overview_store_set_default_icon_internal (EphyOverviewStore *store,
+ GtkTreeIter *iter,
+ GdkPixbuf *default_icon)
+{
+ gtk_list_store_set (GTK_LIST_STORE (store), iter,
+ EPHY_OVERVIEW_STORE_SNAPSHOT,
+ default_icon,
+ EPHY_OVERVIEW_STORE_SNAPSHOT_MTIME, 0,
+ -1);
+}
+
static void
on_snapshot_retrieved_cb (GObject *object,
GAsyncResult *res,
@@ -420,11 +433,8 @@ ephy_overview_store_peek_snapshot (EphyOverviewStore *self,
g_object_unref (cancellable);
}
- gtk_list_store_set (GTK_LIST_STORE (self), iter,
- EPHY_OVERVIEW_STORE_SNAPSHOT,
- self->priv->default_icon,
- EPHY_OVERVIEW_STORE_SNAPSHOT_MTIME, 0,
- -1);
+ 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,
@@ -466,9 +476,8 @@ set_default_icon_helper (GtkTreeModel *model,
-1);
if (current_pixbuf == priv->default_icon ||
current_pixbuf == NULL)
- gtk_list_store_set (GTK_LIST_STORE (model), iter,
- EPHY_OVERVIEW_STORE_SNAPSHOT, new_default_icon,
- -1);
+ ephy_overview_store_set_default_icon_internal (EPHY_OVERVIEW_STORE (model), iter,
+ new_default_icon);
g_object_unref (current_pixbuf);
return FALSE;