aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/ephy-bookmarks.c20
-rw-r--r--src/bookmarks/ephy-bookmarks.h3
2 files changed, 23 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 5e9d539f3..7e1d2bdd5 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -659,6 +659,26 @@ ephy_bookmarks_add (EphyBookmarks *eb,
return bm;
}
+guint
+ephy_bookmarks_get_bookmark_id (EphyBookmarks *eb,
+ const char *url)
+{
+ EphyNode *node;
+
+ g_static_rw_lock_reader_lock (eb->priv->bookmarks_hash_lock);
+ node = g_hash_table_lookup (eb->priv->bookmarks_hash, url);
+ g_static_rw_lock_reader_unlock (eb->priv->bookmarks_hash_lock);
+
+ if (node)
+ {
+ return ephy_node_get_id (node);
+ }
+ else
+ {
+ return -1;
+ }
+}
+
void
ephy_bookmarks_set_icon (EphyBookmarks *eb,
const char *url,
diff --git a/src/bookmarks/ephy-bookmarks.h b/src/bookmarks/ephy-bookmarks.h
index d2b1d7915..169e5a841 100644
--- a/src/bookmarks/ephy-bookmarks.h
+++ b/src/bookmarks/ephy-bookmarks.h
@@ -69,6 +69,9 @@ EphyNode *ephy_bookmarks_add (EphyBookmarks *eb,
const char *smart_url,
const char *keywords);
+guint ephy_bookmarks_get_bookmark_id (EphyBookmarks *eb,
+ const char *url);
+
void ephy_bookmarks_set_icon (EphyBookmarks *eb,
const char *url,
const char *icon);