aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmark-action.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-03-02 05:30:47 +0800
committerChristian Persch <chpe@src.gnome.org>2004-03-02 05:30:47 +0800
commitf460e4b8e7ab36fc1deeb753a1ca8baa7d6116b8 (patch)
tree70d0d4b98c5735aecb4b415b958acd777363f864 /src/bookmarks/ephy-bookmark-action.c
parent67a48b9741659c516d6e62f0a9f85a3493d8010f (diff)
downloadgsoc2013-epiphany-f460e4b8e7ab36fc1deeb753a1ca8baa7d6116b8.tar
gsoc2013-epiphany-f460e4b8e7ab36fc1deeb753a1ca8baa7d6116b8.tar.gz
gsoc2013-epiphany-f460e4b8e7ab36fc1deeb753a1ca8baa7d6116b8.tar.bz2
gsoc2013-epiphany-f460e4b8e7ab36fc1deeb753a1ca8baa7d6116b8.tar.lz
gsoc2013-epiphany-f460e4b8e7ab36fc1deeb753a1ca8baa7d6116b8.tar.xz
gsoc2013-epiphany-f460e4b8e7ab36fc1deeb753a1ca8baa7d6116b8.tar.zst
gsoc2013-epiphany-f460e4b8e7ab36fc1deeb753a1ca8baa7d6116b8.zip
Correctly sync the smarturl property of EphyBookmarksAction when it
2004-03-01 Christian Persch <chpe@cvs.gnome.org> * src/bookmarks/ephy-bookmark-action.c: (smart_child_added_cb), (smart_child_removed_cb), (ephy_bookmark_action_init): Correctly sync the smarturl property of EphyBookmarksAction when it changes. Fixes incorrect show/hide of the entry on the bookmarks toolbar.
Diffstat (limited to 'src/bookmarks/ephy-bookmark-action.c')
-rw-r--r--src/bookmarks/ephy-bookmark-action.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index ee2104506..68bad78fd 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -525,6 +525,29 @@ bookmarks_child_changed_cb (EphyNode *node,
}
static void
+smart_child_added_cb (EphyNode *smart_bmks,
+ EphyNode *child,
+ EphyBookmarkAction *action)
+{
+ if (action->priv->bookmark_id == ephy_node_get_id (child))
+ {
+ g_object_set (action, "smarturl", TRUE, NULL);
+ }
+}
+
+static void
+smart_child_removed_cb (EphyNode *smart_bmks,
+ EphyNode *child,
+ guint old_index,
+ EphyBookmarkAction *action)
+{
+ if (action->priv->bookmark_id == ephy_node_get_id (child))
+ {
+ g_object_set (action, "smarturl", FALSE, NULL);
+ }
+}
+
+static void
ephy_bookmark_action_init (EphyBookmarkAction *action)
{
EphyBookmarks *bookmarks;
@@ -540,6 +563,13 @@ ephy_bookmark_action_init (EphyBookmarkAction *action)
ephy_node_signal_connect_object (node, EPHY_NODE_CHILD_CHANGED,
(EphyNodeCallback) bookmarks_child_changed_cb,
G_OBJECT (action));
+ node = ephy_bookmarks_get_smart_bookmarks (bookmarks);
+ ephy_node_signal_connect_object (node, EPHY_NODE_CHILD_ADDED,
+ (EphyNodeCallback) smart_child_added_cb,
+ G_OBJECT (action));
+ ephy_node_signal_connect_object (node, EPHY_NODE_CHILD_REMOVED,
+ (EphyNodeCallback) smart_child_removed_cb,
+ G_OBJECT (action));
}
GtkAction *