From 42f980437991a70c387ca5e81b97805dbfa2d85d Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Mon, 20 Aug 2012 13:21:53 +0300 Subject: 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 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'embed/ephy-embed-shell.c') diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index 09bbc41bf..a87095f2c 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,33 @@ ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell) return G_OBJECT (shell->priv->global_history_service); } +/** + * ephy_embed_shell_get_frecent_store: + * @shell: a #EphyEmbedShell + * + * Gets the #EphyFrecentStore in the shell. This can be used + * by EphyOverview implementors. + * + * Returns: (transfer none): a #EphyFrecentStore + **/ +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) { -- cgit v1.2.3