aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-06-28 21:14:47 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-06-28 21:14:47 +0800
commitc1ced24c7457d8991bc2e44c7cc784fe1215947c (patch)
tree59427b00f369dbe6f139a0187bf0c710a99c1bd9 /src/bookmarks
parentcc8e17fdc6434920c709ecdc8aef54ed70f9c66e (diff)
downloadgsoc2013-epiphany-c1ced24c7457d8991bc2e44c7cc784fe1215947c.tar
gsoc2013-epiphany-c1ced24c7457d8991bc2e44c7cc784fe1215947c.tar.gz
gsoc2013-epiphany-c1ced24c7457d8991bc2e44c7cc784fe1215947c.tar.bz2
gsoc2013-epiphany-c1ced24c7457d8991bc2e44c7cc784fe1215947c.tar.lz
gsoc2013-epiphany-c1ced24c7457d8991bc2e44c7cc784fe1215947c.tar.xz
gsoc2013-epiphany-c1ced24c7457d8991bc2e44c7cc784fe1215947c.tar.zst
gsoc2013-epiphany-c1ced24c7457d8991bc2e44c7cc784fe1215947c.zip
Fallback using directories to detect format if the mime is not relevant.
2003-06-28 Marco Pesenti Gritti <marco@it.gnome.org> * configure.in: * src/bookmarks/ephy-bookmarks-editor.c: (cmd_bookmarks_import): * src/bookmarks/ephy-bookmarks-import.c: (ephy_bookmarks_import): * src/bookmarks/ephy-bookmarks-import.h: Fallback using directories to detect format if the mime is not relevant.
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c7
-rw-r--r--src/bookmarks/ephy-bookmarks-import.c13
-rw-r--r--src/bookmarks/ephy-bookmarks-import.h4
3 files changed, 19 insertions, 5 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 95e878b3d..789239ad7 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -535,12 +535,11 @@ cmd_bookmarks_import (EggAction *action,
gtk_widget_show (menu);
add_bookmarks_source_menu (menu, _("Mozilla bookmarks"),
- ".mozilla", "bookmarks.html");
+ MOZILLA_BOOKMARKS_DIR, "bookmarks.html");
add_bookmarks_source_menu (menu, _("Galeon bookmarks"),
- ".galeon", "bookmarks.xbel");
+ GALEON_BOOKMARKS_DIR, "bookmarks.xbel");
add_bookmarks_source_menu (menu, _("Konqueror bookmarks"),
- ".kde/share/apps/konqueror",
- "bookmarks.xml");
+ KDE_BOOKMARKS_DIR, "bookmarks.xml");
option_menu = gtk_option_menu_new ();
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
diff --git a/src/bookmarks/ephy-bookmarks-import.c b/src/bookmarks/ephy-bookmarks-import.c
index 778186039..884b856ee 100644
--- a/src/bookmarks/ephy-bookmarks-import.c
+++ b/src/bookmarks/ephy-bookmarks-import.c
@@ -77,10 +77,21 @@ ephy_bookmarks_import (EphyBookmarks *bookmarks,
{
return ephy_bookmarks_import_mozilla (bookmarks, filename);
}
- else
+ else if (strcmp (type, "application/xbel") == 0)
{
return ephy_bookmarks_import_xbel (bookmarks, filename);
}
+ else if (strstr (filename, MOZILLA_BOOKMARKS_DIR) != NULL)
+ {
+ return ephy_bookmarks_import_mozilla (bookmarks, filename);
+ }
+ else if (strstr (filename, GALEON_BOOKMARKS_DIR) != NULL ||
+ strstr (filename, KDE_BOOKMARKS_DIR) != NULL)
+ {
+ return ephy_bookmarks_import_xbel (bookmarks, filename);
+ }
+
+ return FALSE;
}
static void
diff --git a/src/bookmarks/ephy-bookmarks-import.h b/src/bookmarks/ephy-bookmarks-import.h
index fad58fc11..1aec1fa53 100644
--- a/src/bookmarks/ephy-bookmarks-import.h
+++ b/src/bookmarks/ephy-bookmarks-import.h
@@ -23,6 +23,10 @@
G_BEGIN_DECLS
+#define MOZILLA_BOOKMARKS_DIR ".mozilla"
+#define GALEON_BOOKMARKS_DIR ".galeon"
+#define KDE_BOOKMARKS_DIR ".kde/share/apps/konqueror"
+
gboolean ephy_bookmarks_import (EphyBookmarks *bookmarks,
const char *filename);