aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks/ephy-bookmarks.c')
-rw-r--r--src/bookmarks/ephy-bookmarks.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index e12eec366..0d520f2ac 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -476,6 +476,29 @@ history_cleared_cb (EphyHistory *history, EphyBookmarks *bookmarks)
clear_favorites (bookmarks);
}
+#include <gtk/gtkmessagedialog.h>
+#include <gtk/gtkdialog.h>
+
+static void
+redirect_cb (EphyHistory *history,
+ const char *from_uri,
+ const char *to_uri,
+ EphyBookmarks *eb)
+{
+ EphyNode *bookmark;
+ GValue value = { 0, };
+
+ bookmark = ephy_bookmarks_find_bookmark (eb, from_uri);
+ if (bookmark != NULL)
+ {
+ g_value_init (&value, G_TYPE_STRING);
+ g_value_set_string (&value, to_uri);
+ ephy_node_set_property (bookmark, EPHY_NODE_BMK_PROP_LOCATION,
+ &value);
+ g_value_unset (&value);
+ }
+}
+
static void
ephy_setup_history_notifiers (EphyBookmarks *eb)
{
@@ -492,6 +515,8 @@ ephy_setup_history_notifiers (EphyBookmarks *eb)
G_CALLBACK (history_site_visited_cb), eb);
g_signal_connect (history, "cleared",
G_CALLBACK (history_cleared_cb), eb);
+ g_signal_connect (history, "redirect",
+ G_CALLBACK (redirect_cb), eb);
}
static void