aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks.c
diff options
context:
space:
mode:
authorPeter Harvey <peter.a.harvey@gmail.com>2006-01-28 06:14:44 +0800
committerPeter Anthony Harvey <paharvey@src.gnome.org>2006-01-28 06:14:44 +0800
commit233920bda728e2fce61a75887ef59b35fc5d6d33 (patch)
tree73cef92c31d71ee79b882b050a1c7a259577a711 /src/bookmarks/ephy-bookmarks.c
parent81d60265f6dc7b29d716328c5171546cc24e5f58 (diff)
downloadgsoc2013-epiphany-233920bda728e2fce61a75887ef59b35fc5d6d33.tar.gz
gsoc2013-epiphany-233920bda728e2fce61a75887ef59b35fc5d6d33.tar.zst
gsoc2013-epiphany-233920bda728e2fce61a75887ef59b35fc5d6d33.zip
src/bookmarks/ephy-bookmark-properties.c src/bookmarks/ephy-bookmarks-ui.c
2006-01-22 Peter Harvey <peter.a.harvey@gmail.com> * 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.
Diffstat (limited to 'src/bookmarks/ephy-bookmarks.c')
-rw-r--r--src/bookmarks/ephy-bookmarks.c41
1 files changed, 41 insertions, 0 deletions
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,