[epiphany/in-tab-overview: 18/24] ephy-embed-shell: add a frecent store to the shell



commit 83afe205fef9dfeb6b4a702b6ca4a3e740d55563
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Mon Aug 20 13:21:53 2012 +0300

    ephy-embed-shell: add a frecent store to the shell
    
    Since we will use the overview in each tab and these should share
    the underlying model.

 embed/ephy-embed-shell.c |   22 ++++++++++++++++++++++
 embed/ephy-embed-shell.h |    3 +++
 src/Makefile.am          |    1 +
 3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 09bbc41..9bfac59 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -57,6 +57,7 @@ struct _EphyEmbedShellPrivate
 	GtkPageSetup *page_setup;
 	GtkPrintSettings *print_settings;
 	EphyEmbedShellMode mode;
+	EphyFrecentStore *frecent_store;
 	guint single_initialised : 1;
 };
 
@@ -111,6 +112,9 @@ ephy_embed_shell_dispose (GObject *object)
 		priv->print_settings = NULL;
 	}
 
+	if (priv->frecent_store != NULL)
+		g_clear_object (&priv->frecent_store);
+
 	G_OBJECT_CLASS (ephy_embed_shell_parent_class)->dispose (object);
 }
 
@@ -173,6 +177,24 @@ ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell)
 	return G_OBJECT (shell->priv->global_history_service);
 }
 
+EphyFrecentStore *
+ephy_embed_shell_get_frecent_store (EphyEmbedShell *shell)
+{
+	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 ();
+		g_object_set (shell->priv->frecent_store,
+			      "history-service",
+			      ephy_embed_shell_get_global_history_service (shell),
+			      "history-length", 10,
+			      NULL);
+	}
+
+	return shell->priv->frecent_store;
+}
+
 static GObject *
 impl_get_embed_single (EphyEmbedShell *shell)
 {
diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h
index 8f4717b..84c9a45 100644
--- a/embed/ephy-embed-shell.h
+++ b/embed/ephy-embed-shell.h
@@ -31,6 +31,7 @@
 #include <gtk/gtk.h>
 
 #include "ephy-download.h"
+#include "ephy-frecent-store.h"
 
 G_BEGIN_DECLS
 
@@ -82,6 +83,8 @@ EphyEmbedShell	  *ephy_embed_shell_get_default		(void);
 
 GObject		  *ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell);
 
+EphyFrecentStore  *ephy_embed_shell_get_frecent_store   (EphyEmbedShell *shell);
+
 GObject		  *ephy_embed_shell_get_encodings	(EphyEmbedShell *shell);
 
 GObject		  *ephy_embed_shell_get_embed_single	(EphyEmbedShell *shell);
diff --git a/src/Makefile.am b/src/Makefile.am
index 61b6fbe..6c6d133 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -146,6 +146,7 @@ epiphany_CPPFLAGS = \
 	-I$(top_srcdir)/lib   		\
 	-I$(top_srcdir)/lib/egg		\
 	-I$(top_srcdir)/lib/history	\
+	-I$(top_srcdir)/lib/widgets	\
 	-I$(top_srcdir)/src/bookmarks   \
 	-DDATADIR=\""$(datadir)"\" 	\
 	-DGNOMELOCALEDIR=\"$(datadir)/locale\"	\



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