aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-03-25 07:04:29 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-03-25 07:04:29 +0800
commit674c6c88ec079fe16688296835fdc6da0820832f (patch)
treed127eb289f7f342dc4b37b010d5640e7fe02ab4c
parent0dd895b5ec8984bcbb10d1df91a26cf0e4e70771 (diff)
downloadgsoc2013-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
-rw-r--r--ChangeLog8
-rw-r--r--TODO4
-rw-r--r--src/bookmarks/ephy-bookmarks-import.c36
3 files changed, 36 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index dd14dbf19..911f4c092 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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
+
2003-03-24 Xan Lopez <xan@masilla.org>
* TODO:
diff --git a/TODO b/TODO
index 383827bc3..5c4b8980e 100644
--- a/TODO
+++ b/TODO
@@ -5,14 +5,10 @@ Bookmarks:
- Good editor menu layout, accells ...
- Select All menu, useful to open several windows at a time
- Space should toggle topics checkboxes, maybe also click on the title ?
-- Fix import to s/folder/topic again
- context menu on topics list
-- The keyword field of the bookmark need to be updated topic set/unset,
- otherwise completion will not work
- Consistent use of topics instead of keywords in the code
- Drag topics on the toolbar
- "Not categorized" topic. Same prob as above.
-- Do we need "All" ? (daveb says yes, its a database, we should provide a way to access and search the whole thing)
Others:
- if you change mozilla settings when ephy is not running, they arent updated in prefs.js
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);