aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-07-04 22:15:49 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-07-04 22:15:49 +0800
commit0774d40cedbde3a4c8751d02e237f7b3b0e25572 (patch)
treed551ee3ee49b76db5ab2b1369bdcece3f1ee0a0e /src/bookmarks
parent53e29e3ec1e3d6f72118873a221cdf2bc621091b (diff)
downloadgsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar.gz
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar.bz2
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar.lz
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar.xz
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar.zst
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.zip
Remove use of acconfig.h.
2003-07-04 Marco Pesenti Gritti <marco@it.gnome.org> * configure.in: Remove use of acconfig.h. * embed/ephy-embed-shell.c: (ephy_embed_shell_get_embed_single): * embed/ephy-embed-single.c: * embed/ephy-embed-single.h: * embed/mozilla/ContentHandler.cpp: * embed/mozilla/EphyWrapper.cpp: * embed/mozilla/Makefile.am: * embed/mozilla/MozRegisterComponents.cpp: * embed/mozilla/MozRegisterComponents.h: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed-single.h: * src/bookmarks/ephy-bookmarks-import.c: (bookmark_add), (xbel_parse_folder), (ephy_bookmarks_import_mozilla): * src/ephy-shell.c: (ephy_shell_init): Show an alert when mozilla cant start instead of crashing. Do not import bookmarks dups. Cleanup some mozilla code headers inclusion.
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/ephy-bookmarks-import.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/src/bookmarks/ephy-bookmarks-import.c b/src/bookmarks/ephy-bookmarks-import.c
index 884b856ee..8a50fc62c 100644
--- a/src/bookmarks/ephy-bookmarks-import.c
+++ b/src/bookmarks/ephy-bookmarks-import.c
@@ -43,22 +43,29 @@ typedef struct _XbelInfo
char *smarturl;
} XbelInfo;
-static EphyNode *
-set_folder (EphyBookmarks *bookmarks,
- EphyNode *bookmark,
- const char *name)
+static void
+bookmark_add (EphyBookmarks *bookmarks,
+ const char *title,
+ const char *address,
+ const char *topic_name)
{
EphyNode *topic;
+ EphyNode *bmk;
- topic = ephy_bookmarks_find_keyword (bookmarks, name, FALSE);
- if (topic == NULL)
- {
- topic = ephy_bookmarks_add_keyword (bookmarks, name);
- }
+ if (ephy_bookmarks_find_bookmark (bookmarks, address)) return;
- ephy_bookmarks_set_keyword (bookmarks, topic, bookmark);
+ bmk = ephy_bookmarks_add (bookmarks, title, address);
- return topic;
+ if (topic_name)
+ {
+ topic = ephy_bookmarks_find_keyword (bookmarks, topic_name, FALSE);
+ if (topic == NULL)
+ {
+ topic = ephy_bookmarks_add_keyword (bookmarks, topic_name);
+ }
+
+ ephy_bookmarks_set_keyword (bookmarks, topic, bmk);
+ }
}
gboolean
@@ -144,7 +151,6 @@ xbel_parse_folder (EphyBookmarks *bookmarks,
{
XbelInfo *xbel;
xmlChar *url;
- EphyNode *bmk;
xbel = g_new0 (XbelInfo, 1);
xbel->title = NULL;
@@ -156,14 +162,7 @@ xbel_parse_folder (EphyBookmarks *bookmarks,
child->children,
xbel);
- /* FIXME need to import also smart bookmark */
- bmk = ephy_bookmarks_add (bookmarks,
- xbel->title,
- url);
- if (keyword)
- {
- set_folder (bookmarks, bmk, keyword);
- }
+ bookmark_add (bookmarks, xbel->title, url, keyword);
xmlFree (url);
@@ -393,7 +392,6 @@ ephy_bookmarks_import_mozilla (EphyBookmarks *bookmarks,
gchar *parsedname;
GString *url = g_string_new (NULL);
char *current_folder = NULL;
- EphyNode *bmk;
if (!(bf = fopen (filename, "r"))) {
g_warning ("Failed to open file: %s\n", filename);
@@ -411,10 +409,9 @@ ephy_bookmarks_import_mozilla (EphyBookmarks *bookmarks,
break;
case NS_SITE:
parsedname = ns_parse_bookmark_item (name);
- bmk = ephy_bookmarks_add (bookmarks,
- parsedname,
- url->str);
- set_folder (bookmarks, bmk, current_folder);
+
+ bookmark_add (bookmarks, parsedname,
+ url->str, current_folder);
break;
default:
break;