aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-start-here.c
diff options
context:
space:
mode:
authorJames Willcox <jwillcox@gnome.org>2003-02-06 09:55:50 +0800
committerJames Willcox <jwillcox@src.gnome.org>2003-02-06 09:55:50 +0800
commit5a4dc61b3d5599842daef9004cb4a61c28c4dffa (patch)
treee7d10dec4ea563a2b63f6516b858acd5c358bedd /lib/ephy-start-here.c
parent2f1334d2b432eec9ed13d64ac350beeeea43b49f (diff)
downloadgsoc2013-epiphany-5a4dc61b3d5599842daef9004cb4a61c28c4dffa.tar
gsoc2013-epiphany-5a4dc61b3d5599842daef9004cb4a61c28c4dffa.tar.gz
gsoc2013-epiphany-5a4dc61b3d5599842daef9004cb4a61c28c4dffa.tar.bz2
gsoc2013-epiphany-5a4dc61b3d5599842daef9004cb4a61c28c4dffa.tar.lz
gsoc2013-epiphany-5a4dc61b3d5599842daef9004cb4a61c28c4dffa.tar.xz
gsoc2013-epiphany-5a4dc61b3d5599842daef9004cb4a61c28c4dffa.tar.zst
gsoc2013-epiphany-5a4dc61b3d5599842daef9004cb4a61c28c4dffa.zip
Added the ability to import galeon and konqueror bookmarks.
2003-02-05 James Willcox <jwillcox@gnome.org> * data/starthere/section.xsl: * embed/mozilla/StartHereProtocolHandler.cpp: * lib/ephy-start-here.c: (galeon_bookmarks), (attach_content): * src/bookmarks/ephy-bookmarks-import.c: (xbel_parse_single_bookmark), (xbel_parse_folder), (xbel_parse_bookmarks), (ephy_bookmarks_import_mozilla), (ephy_bookmarks_import_xbel): * src/bookmarks/ephy-bookmarks-import.h: * src/ephy-shell.c: (ephy_shell_command_cb): Added the ability to import galeon and konqueror bookmarks.
Diffstat (limited to 'lib/ephy-start-here.c')
-rw-r--r--lib/ephy-start-here.c66
1 files changed, 64 insertions, 2 deletions
diff --git a/lib/ephy-start-here.c b/lib/ephy-start-here.c
index 40b23c452..06d08de38 100644
--- a/lib/ephy-start-here.c
+++ b/lib/ephy-start-here.c
@@ -220,6 +220,45 @@ mozilla_bookmarks (void)
return result;
}
+static char *
+galeon_bookmarks (void)
+{
+ GSList *l;
+ char *dir;
+ char *result;
+
+ dir = g_build_filename (g_get_home_dir (), ".galeon", NULL);
+ l = ephy_file_find (dir, "bookmarks.xbel", 4);
+ g_free (dir);
+
+ result = l ? g_strdup (l->data) : NULL;
+
+ g_slist_foreach (l, (GFunc) g_free, NULL);
+ g_slist_free (l);
+
+ return result;
+}
+
+static char *
+konqueror_bookmarks (void)
+{
+ GSList *l;
+ char *dir;
+ char *result;
+
+ dir = g_build_filename (g_get_home_dir (), ".kde", "share",
+ "apps", "konqueror", NULL);
+ l = ephy_file_find (dir, "bookmarks.xml", 4);
+ g_free (dir);
+
+ result = l ? g_strdup (l->data) : NULL;
+
+ g_slist_foreach (l, (GFunc) g_free, NULL);
+ g_slist_free (l);
+
+ return result;
+}
+
static void
attach_content (EphyStartHere *sh, xmlNodePtr node, xmlChar *id)
{
@@ -232,12 +271,35 @@ attach_content (EphyStartHere *sh, xmlNodePtr node, xmlChar *id)
if (bmk_file)
{
child = xmlNewDocNode (sh->priv->doc, NULL, "action",
- _("Import mozilla bookmarks"));
- xmlSetProp (child, "id", "import-bookmarks");
+ _("Import Mozilla bookmarks"));
+ xmlSetProp (child, "id", "import-mozilla-bookmarks");
+ xmlSetProp (child, "param", bmk_file);
+ xmlAddChild (node, child);
+ }
+ g_free (bmk_file);
+
+ bmk_file = galeon_bookmarks ();
+ if (bmk_file)
+ {
+ child = xmlNewDocNode (sh->priv->doc, NULL, "action",
+ _("Import Galeon bookmarks"));
+ xmlSetProp (child, "id", "import-galeon-bookmarks");
+ xmlSetProp (child, "param", bmk_file);
+ xmlAddChild (node, child);
+ }
+ g_free (bmk_file);
+
+ bmk_file = konqueror_bookmarks ();
+ if (bmk_file)
+ {
+ child = xmlNewDocNode (sh->priv->doc, NULL, "action",
+ _("Import Konqueror bookmarks"));
+ xmlSetProp (child, "id", "import-konqueror-bookmarks");
xmlSetProp (child, "param", bmk_file);
xmlAddChild (node, child);
}
g_free (bmk_file);
+
}
}