diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-07-27 01:41:04 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-07-27 01:41:04 +0800 |
commit | fc69f229f306940d351fd20606fe6a77104ef48d (patch) | |
tree | 4ebf2c194552d38c330a9ac974b5c38abe1b198c /src/bookmarks/ephy-topic-action.c | |
parent | 185ea56fa4d1b5626ff1418a90d979f3cc15b108 (diff) | |
download | gsoc2013-epiphany-fc69f229f306940d351fd20606fe6a77104ef48d.tar gsoc2013-epiphany-fc69f229f306940d351fd20606fe6a77104ef48d.tar.gz gsoc2013-epiphany-fc69f229f306940d351fd20606fe6a77104ef48d.tar.bz2 gsoc2013-epiphany-fc69f229f306940d351fd20606fe6a77104ef48d.tar.lz gsoc2013-epiphany-fc69f229f306940d351fd20606fe6a77104ef48d.tar.xz gsoc2013-epiphany-fc69f229f306940d351fd20606fe6a77104ef48d.tar.zst gsoc2013-epiphany-fc69f229f306940d351fd20606fe6a77104ef48d.zip |
Unify bookmarks/smart bookmarks address resolution, and add a signal to
2005-07-26 Christian Persch <chpe@cvs.gnome.org>
* lib/ephy-marshal.list:
* src/bookmarks/ephy-bookmark-action.c: (open_in_tab_activate_cb),
(open_in_window_activate_cb), (activate_cb):
* src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_class_init),
(impl_resolve_address), (ephy_bookmarks_resolve_address):
* src/bookmarks/ephy-bookmarks.h:
* src/bookmarks/ephy-topic-action.c: (menu_activate_cb),
(open_in_tabs_activate_cb):
* src/ephy-location-action.c: (action_activated_cb),
(entry_activate_cb):
* src/epiphany.defs:
Unify bookmarks/smart bookmarks address resolution, and add a signal
to EphyBookmarks for it.
Diffstat (limited to 'src/bookmarks/ephy-topic-action.c')
-rw-r--r-- | src/bookmarks/ephy-topic-action.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c index 1ca923fb2..51cb42e60 100644 --- a/src/bookmarks/ephy-topic-action.c +++ b/src/bookmarks/ephy-topic-action.c @@ -161,15 +161,24 @@ menu_deactivate_cb (GtkMenuShell *ms, GtkWidget *button) static void menu_activate_cb (GtkWidget *item, GtkAction *action) { + EphyBookmarks *bookmarks; EphyNode *node; const char *location; + char *address; node = g_object_get_data (G_OBJECT (item), "node"); location = ephy_node_get_property_string (node, EPHY_NODE_BMK_PROP_LOCATION); + g_return_if_fail (location != NULL); + + bookmarks = ephy_shell_get_bookmarks (ephy_shell_get_default ()); + address = ephy_bookmarks_resolve_address (bookmarks, location, NULL); + g_return_if_fail (address != NULL); - ephy_link_open (EPHY_LINK (action), location, NULL, + ephy_link_open (EPHY_LINK (action), address, NULL, ephy_gui_is_middle_click () ? EPHY_LINK_NEW_TAB : 0); + + g_free (address); } static void @@ -332,6 +341,7 @@ append_bookmarks_menu (EphyTopicAction *action, GtkWidget *menu, EphyNode *node, static void open_in_tabs_activate_cb (GtkWidget *item, EphyTopicAction *action) { + EphyBookmarks *bookmarks; EphyNode *node; GPtrArray *children; EphyTab *tab = NULL; @@ -350,16 +360,24 @@ open_in_tabs_activate_cb (GtkWidget *item, EphyTopicAction *action) node_list = g_list_sort (node_list, (GCompareFunc) sort_bookmarks); + bookmarks = ephy_shell_get_bookmarks (ephy_shell_get_default ()); + for (l = node_list; l != NULL; l = l->next) { EphyNode *child = (EphyNode *) l->data; - const char *address; + const char *location; + char *address; - address = ephy_node_get_property_string + location = ephy_node_get_property_string (child, EPHY_NODE_BMK_PROP_LOCATION); + g_return_if_fail (location != NULL); + + address = ephy_bookmarks_resolve_address (bookmarks, location, NULL); + g_return_if_fail (address != NULL); tab = ephy_link_open (EPHY_LINK (action), address, tab, tab ? EPHY_LINK_NEW_TAB : EPHY_LINK_NEW_WINDOW); + g_free (address); } g_list_free (node_list); |