diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-03-25 07:04:29 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-03-25 07:04:29 +0800 |
commit | 674c6c88ec079fe16688296835fdc6da0820832f (patch) | |
tree | d127eb289f7f342dc4b37b010d5640e7fe02ab4c /src | |
parent | 0dd895b5ec8984bcbb10d1df91a26cf0e4e70771 (diff) | |
download | gsoc2013-epiphany-674c6c88ec079fe16688296835fdc6da0820832f.tar gsoc2013-epiphany-674c6c88ec079fe16688296835fdc6da0820832f.tar.gz gsoc2013-epiphany-674c6c88ec079fe16688296835fdc6da0820832f.tar.bz2 gsoc2013-epiphany-674c6c88ec079fe16688296835fdc6da0820832f.tar.lz gsoc2013-epiphany-674c6c88ec079fe16688296835fdc6da0820832f.tar.xz gsoc2013-epiphany-674c6c88ec079fe16688296835fdc6da0820832f.tar.zst gsoc2013-epiphany-674c6c88ec079fe16688296835fdc6da0820832f.zip |
Fix to use the new api
2003-03-25 Marco Pesenti Gritti <marco@it.gnome.org>
* TODO:
* src/bookmarks/ephy-bookmarks-import.c: (set_folder),
(mozilla_parse_bookmarks), (xbel_parse_folder):
Fix to use the new api
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/ephy-bookmarks-import.c | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/bookmarks/ephy-bookmarks-import.c b/src/bookmarks/ephy-bookmarks-import.c index 4eda2a025..3950c3090 100644 --- a/src/bookmarks/ephy-bookmarks-import.c +++ b/src/bookmarks/ephy-bookmarks-import.c @@ -35,6 +35,22 @@ build_keyword (const char *folder) return ephy_str_replace_substring (folder, " ", "_"); } +static EphyNode * +set_folder (EphyBookmarks *bookmarks, + EphyNode *bookmark, + const char *name) +{ + EphyNode *topic; + + topic = ephy_bookmarks_find_keyword (bookmarks, name, FALSE); + if (topic == NULL) + { + topic = ephy_bookmarks_add_keyword (bookmarks, name); + } + + ephy_bookmarks_set_keyword (bookmarks, topic, bookmark); +} + static void mozilla_parse_bookmarks (EphyBookmarks *bookmarks, htmlNodePtr node, @@ -56,13 +72,15 @@ mozilla_parse_bookmarks (EphyBookmarks *bookmarks, else if (xmlStrEqual (child->name, "a")) { xmlChar *title, *url; + EphyNode *bmk; title = xmlNodeGetContent (child); url = xmlGetProp (child, "href"); - ephy_bookmarks_add (bookmarks, - title, - url, - NULL); + bmk = ephy_bookmarks_add (bookmarks, + title, + url, + NULL); + set_folder (bookmarks, bmk, *keyword); xmlFree (title); xmlFree (url); } @@ -132,6 +150,7 @@ xbel_parse_folder (EphyBookmarks *bookmarks, { XbelInfo *xbel; xmlChar *url; + EphyNode *bmk; xbel = g_new0 (XbelInfo, 1); xbel->title = NULL; @@ -143,10 +162,11 @@ xbel_parse_folder (EphyBookmarks *bookmarks, child->children, xbel); - ephy_bookmarks_add (bookmarks, - xbel->title, - url, - xbel->smarturl); + bmk = ephy_bookmarks_add (bookmarks, + xbel->title, + url, + xbel->smarturl); + set_folder (bookmarks, bmk, keyword); if (url) xmlFree (url); |