[epiphany] ephy-overview-store: add internal helper for setting the default icon
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-overview-store: add internal helper for setting the default icon
- Date: Fri, 31 Aug 2012 18:42:58 +0000 (UTC)
commit a24c76b3eadb61b1964d6a7e1164c6a9bcf247e2
Author: Claudio Saavedra <csaavedra igalia com>
Date: Wed Aug 29 17:40:23 2012 +0300
ephy-overview-store: add internal helper for setting the default icon
Just to spare some code repetition.
lib/widgets/ephy-overview-store.c | 25 +++++++++++++++++--------
1 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/lib/widgets/ephy-overview-store.c b/lib/widgets/ephy-overview-store.c
index c5e1e2a..1ceb56b 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]