aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-08-20 18:21:53 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-09-01 02:34:00 +0800
commit42f980437991a70c387ca5e81b97805dbfa2d85d (patch)
tree1ea7daf7b8aa7d451386f616338cf682f51dddab /embed
parent224d74346147e3810069dc33367a49f4b3a6091c (diff)
downloadgsoc2013-epiphany-42f980437991a70c387ca5e81b97805dbfa2d85d.tar
gsoc2013-epiphany-42f980437991a70c387ca5e81b97805dbfa2d85d.tar.gz
gsoc2013-epiphany-42f980437991a70c387ca5e81b97805dbfa2d85d.tar.bz2
gsoc2013-epiphany-42f980437991a70c387ca5e81b97805dbfa2d85d.tar.lz
gsoc2013-epiphany-42f980437991a70c387ca5e81b97805dbfa2d85d.tar.xz
gsoc2013-epiphany-42f980437991a70c387ca5e81b97805dbfa2d85d.tar.zst
gsoc2013-epiphany-42f980437991a70c387ca5e81b97805dbfa2d85d.zip
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.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed-shell.c31
-rw-r--r--embed/ephy-embed-shell.h3
2 files changed, 34 insertions, 0 deletions
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)
{
diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h
index 8f4717bde..84c9a4591 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);