From 233920bda728e2fce61a75887ef59b35fc5d6d33 Mon Sep 17 00:00:00 2001 From: Peter Harvey Date: Fri, 27 Jan 2006 22:14:44 +0000 Subject: src/bookmarks/ephy-bookmark-properties.c src/bookmarks/ephy-bookmarks-ui.c 2006-01-22 Peter Harvey * src/bookmarks/ephy-bookmark-properties.c * src/bookmarks/ephy-bookmarks-ui.c * src/bookmarks/ephy-bookmarks-ui.h * src/bookmarks/ephy-bookmarks.c * src/bookmarks/ephy-bookmarks.h * src/ephy-history-window.c * src/popup-commands.c * src/window-commands.c Simplified the bookmark properties dialog and removed the 'duplicate bookmark' warning dialog (now have warning in the bookmark properties dialog itself). * src/bookmarks/ephy-topics-palette.c Added a header which switches topic palette mode. --- src/bookmarks/ephy-bookmarks.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src/bookmarks/ephy-bookmarks.c') diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index 0aa4ef175..7770265f7 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -1186,6 +1186,47 @@ ephy_bookmarks_find_bookmark (EphyBookmarks *eb, return NULL; } +EphyNode * +ephy_bookmarks_find_duplicate (EphyBookmarks *eb, + EphyNode *bookmark) +{ + GPtrArray *children; + const char *url; + int i; + + g_return_val_if_fail (EPHY_IS_BOOKMARKS (eb), NULL); + g_return_val_if_fail (eb->priv->bookmarks != NULL, NULL); + g_return_val_if_fail (bookmark != NULL, NULL); + + url = ephy_node_get_property_string + (bookmark, EPHY_NODE_BMK_PROP_LOCATION); + + g_return_val_if_fail (url != NULL, NULL); + + children = ephy_node_get_children (eb->priv->bookmarks); + for (i = 0; i < children->len; i++) + { + EphyNode *kid; + const char *location; + + kid = g_ptr_array_index (children, i); + if (kid == bookmark) + { + continue; + } + + location = ephy_node_get_property_string + (kid, EPHY_NODE_BMK_PROP_LOCATION); + + if (location != NULL && strcmp (url, location) == 0) + { + return kid; + } + } + + return NULL; +} + void ephy_bookmarks_set_icon (EphyBookmarks *eb, const char *url, -- cgit v1.2.3