From 0774d40cedbde3a4c8751d02e237f7b3b0e25572 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 4 Jul 2003 14:15:49 +0000 Subject: Remove use of acconfig.h. 2003-07-04 Marco Pesenti Gritti * 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. --- embed/mozilla/mozilla-embed-single.cpp | 43 +++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'embed/mozilla/mozilla-embed-single.cpp') diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 437e6edb7..6d03e08d4 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -37,7 +37,6 @@ #include #include #include -#include "nsBuildID.h" #include #include #include @@ -45,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -250,8 +248,6 @@ struct MozillaEmbedSinglePrivate GtkWidget *theme_window; }; -static NS_DEFINE_CID(kJVMManagerCID, NS_JVMMANAGER_CID); - static GObjectClass *parent_class = NULL; GType @@ -306,17 +302,23 @@ mozilla_embed_single_class_init (MozillaEmbedSingleClass *klass) shell_class->show_file_picker = impl_show_file_picker; } -static void +EphyEmbedSingle * +mozilla_embed_single_new (void) +{ + return EPHY_EMBED_SINGLE (g_object_new (MOZILLA_EMBED_SINGLE_TYPE, NULL)); +} + +static gboolean mozilla_set_default_prefs (MozillaEmbedSingle *mes) { nsCOMPtr prefService; prefService = do_GetService (NS_PREFSERVICE_CONTRACTID); - g_return_if_fail (prefService != NULL); + if (prefService == NULL) return FALSE; nsCOMPtr pref; prefService->GetBranch ("", getter_AddRefs(pref)); - g_return_if_fail (pref != NULL); + if (pref == NULL) return FALSE; /* Don't allow mozilla to raise window when setting focus (work around bugs) */ pref->SetBoolPref ("mozilla.widget.raise-on-setfocus", PR_FALSE); @@ -383,6 +385,8 @@ mozilla_set_default_prefs (MozillaEmbedSingle *mes) sub for embedding apps */ pref->SetCharPref ("general.useragent.vendor", "Epiphany"); pref->SetCharPref ("general.useragent.vendorSub", VERSION); + + return TRUE; } static char * @@ -531,13 +535,18 @@ mozilla_embed_single_init (MozillaEmbedSingle *mes) { mes->priv = g_new0 (MozillaEmbedSinglePrivate, 1); + mes->priv->theme_window = NULL; mes->priv->user_prefs = g_build_filename (ephy_dot_dir (), MOZILLA_PROFILE_DIR, MOZILLA_PROFILE_NAME, MOZILLA_PROFILE_FILE, NULL); +} +gboolean +mozilla_embed_single_init_services (MozillaEmbedSingle *single) +{ /* Pre initialization */ mozilla_init_home (); mozilla_init_profile (); @@ -545,24 +554,27 @@ mozilla_embed_single_init (MozillaEmbedSingle *mes) /* Fire up the best */ gtk_moz_embed_push_startup (); - mozilla_set_default_prefs (mes); + mozilla_init_single (single); + + if (!mozilla_set_default_prefs (single)) + { + return FALSE; + } /* FIXME: This should be removed when mozilla * bugs 207000 and 207001 are fixed. */ - mozilla_setup_colors (mes); + mozilla_setup_colors (single); START_PROFILER ("Mozilla prefs notifiers") - mozilla_notifiers_init (EPHY_EMBED_SINGLE (mes)); + mozilla_notifiers_init (EPHY_EMBED_SINGLE (single)); STOP_PROFILER ("Mozilla prefs notifiers") - mozilla_init_single (mes); - mozilla_register_components (); mozilla_register_external_protocols (); - /* FIXME alert if fails */ + return TRUE; } static void @@ -632,7 +644,10 @@ mozilla_embed_single_finalize (GObject *object) g_free (mes->priv->user_prefs); - gtk_widget_destroy (mes->priv->theme_window); + if (mes->priv->theme_window) + { + gtk_widget_destroy (mes->priv->theme_window); + } g_free (mes->priv); } -- cgit v1.2.3