aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/bookmarks/ephy-bookmarks-import.c47
-rw-r--r--src/ephy-shell.c30
2 files changed, 46 insertions, 31 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;
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 926527193..0d9fac6f3 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -170,13 +170,31 @@ ephy_shell_init (EphyShell *gs)
/* This ensures mozilla is fired up */
single = ephy_embed_shell_get_embed_single (EPHY_EMBED_SHELL (gs));
+ if (single != NULL)
+ {
+ g_signal_connect (G_OBJECT (single),
+ "new_window_orphan",
+ G_CALLBACK(ephy_shell_new_window_cb),
+ NULL);
- g_signal_connect (G_OBJECT (single),
- "new_window_orphan",
- G_CALLBACK(ephy_shell_new_window_cb),
- NULL);
-
- ephy_init_services (gs);
+ ephy_init_services (gs);
+ }
+ else
+ {
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new
+ (NULL,
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ _("Epiphany can't be used now. "
+ "Mozilla initialization failed. Check your "
+ "MOZILLA_FIVE_HOME environmental variable."));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ exit (0);
+ }
}
static void