[epiphany/in-tab-overview: 18/56] ephy-embed-shell: set the default icon for the frecent store



commit b23061ca65b982d8b7a97aa64d46974fb6d0fcf6
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Wed Aug 22 18:41:34 2012 +0300

    ephy-embed-shell: set the default icon for the frecent store
    
    Add a helper method for this.

 embed/ephy-embed-shell.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index a87095f..f8b3c02 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -31,6 +31,7 @@
 #include "ephy-file-helpers.h"
 #include "ephy-history-service.h"
 #include "ephy-print-utils.h"
+#include "ephy-snapshot-service.h"
 
 #include <glib.h>
 #include <glib/gi18n.h>
@@ -186,19 +187,47 @@ ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell)
  *
  * Returns: (transfer none): a #EphyFrecentStore
  **/
+static GdkPixbuf *
+ephy_embed_shell_get_icon (const char *icon_name)
+{
+  GError *error = NULL;
+  GtkIconTheme *icon_theme;
+  GdkPixbuf *pixbuf;
+
+  icon_theme = gtk_icon_theme_get_default ();
+
+  pixbuf = gtk_icon_theme_load_icon (icon_theme,
+                                     icon_name,
+                                     EPHY_THUMBNAIL_WIDTH,
+                                     0,
+                                     &error);
+
+  if (!pixbuf) {
+    g_warning ("Couldn't load icon: %s", error->message);
+    g_error_free (error);
+  }
+
+  return pixbuf;
+}
+
 EphyFrecentStore *
 ephy_embed_shell_get_frecent_store (EphyEmbedShell *shell)
 {
+	GdkPixbuf *default_icon;
+
 	g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
 
 	if (shell->priv->frecent_store == NULL)
 	{
 		shell->priv->frecent_store = ephy_frecent_store_new ();
+		default_icon = ephy_embed_shell_get_icon ("text-html");
 		g_object_set (shell->priv->frecent_store,
 			      "history-service",
 			      ephy_embed_shell_get_global_history_service (shell),
 			      "history-length", 10,
+			      "default-icon", default_icon,
 			      NULL);
+		g_object_unref (default_icon);
 	}
 
 	return shell->priv->frecent_store;



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