diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-10-31 21:22:10 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-10-31 21:22:10 +0800 |
commit | 6b866168d7d5b3702f709b5ecb59454761b9e790 (patch) | |
tree | be857c5857c135318677208e63d94ec1d5c88471 /embed/ephy-history.c | |
parent | 1ff25e7c76cafd5abae29b7e7c058cee3f2f2299 (diff) | |
download | gsoc2013-epiphany-6b866168d7d5b3702f709b5ecb59454761b9e790.tar gsoc2013-epiphany-6b866168d7d5b3702f709b5ecb59454761b9e790.tar.gz gsoc2013-epiphany-6b866168d7d5b3702f709b5ecb59454761b9e790.tar.bz2 gsoc2013-epiphany-6b866168d7d5b3702f709b5ecb59454761b9e790.tar.lz gsoc2013-epiphany-6b866168d7d5b3702f709b5ecb59454761b9e790.tar.xz gsoc2013-epiphany-6b866168d7d5b3702f709b5ecb59454761b9e790.tar.zst gsoc2013-epiphany-6b866168d7d5b3702f709b5ecb59454761b9e790.zip |
Store the redirect and toplevel attributes when adding pages to the
2005-10-31 Christian Persch <chpe@cvs.gnome.org>
* embed/ephy-history.c: (ephy_history_class_init),
(ephy_history_add_page), (impl_add_page):
* embed/ephy-history.h:
* embed/mozilla/GlobalHistory.cpp:
* lib/ephy-marshal.list:
* src/epiphany.defs:
Store the redirect and toplevel attributes when
adding pages to the history (doesn't do anything with
the info yet, though). Based on a galeon patch by tko.
Diffstat (limited to 'embed/ephy-history.c')
-rw-r--r-- | embed/ephy-history.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/embed/ephy-history.c b/embed/ephy-history.c index ce0f9e017..de8109128 100644 --- a/embed/ephy-history.c +++ b/embed/ephy-history.c @@ -63,6 +63,12 @@ struct _EphyHistoryPrivate enum { + REDIRECT_FLAG = 1 << 0, + TOPLEVEL_FLAG = 1 << 1 +}; + +enum +{ PROP_0, PROP_ENABLED }; @@ -81,7 +87,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; static void ephy_history_class_init (EphyHistoryClass *klass); static void ephy_history_init (EphyHistory *history); static void ephy_history_finalize (GObject *object); -static gboolean impl_add_page (EphyHistory *histroy, const char *url); +static gboolean impl_add_page (EphyHistory *, const char *, gboolean, gboolean); static GObjectClass *parent_class = NULL; @@ -188,10 +194,12 @@ ephy_history_class_init (EphyHistoryClass *klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (EphyHistoryClass, add_page), g_signal_accumulator_true_handled, NULL, - ephy_marshal_BOOLEAN__STRING, + ephy_marshal_BOOLEAN__STRING_BOOLEAN_BOOLEAN, G_TYPE_BOOLEAN, - 1, - G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE); + 3, + G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE, + G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN); signals[VISITED] = g_signal_new ("visited", @@ -882,18 +890,24 @@ ephy_history_get_page_visits (EphyHistory *gh, void ephy_history_add_page (EphyHistory *eh, - const char *url) + const char *url, + gboolean redirect, + gboolean toplevel) { gboolean result = FALSE; - g_signal_emit (eh, signals[ADD_PAGE], 0, url, &result); + g_signal_emit (eh, signals[ADD_PAGE], 0, url, redirect, toplevel, &result); } static gboolean -impl_add_page (EphyHistory *eb, const char *url) +impl_add_page (EphyHistory *eb, + const char *url, + gboolean redirect, + gboolean toplevel) { EphyNode *bm, *node, *host; GValue value = { 0, }; + gulong flags = 0; if (eb->priv->enabled == FALSE) { @@ -917,6 +931,16 @@ impl_add_page (EphyHistory *eb, const char *url) &value); g_value_unset (&value); + if (redirect) flags |= REDIRECT_FLAG; + if (toplevel) flags |= TOPLEVEL_FLAG; + + /* EphyNode SUCKS! */ + g_value_init (&value, G_TYPE_LONG); + g_value_set_long (&value, (long) flags); + ephy_node_set_property (bm, EPHY_NODE_PAGE_PROP_EXTRA_FLAGS, + &value); + g_value_unset (&value); + host = ephy_history_add_host (eb, bm); g_value_init (&value, G_TYPE_INT); |