aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);