diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-05-05 00:21:58 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-05-05 00:21:58 +0800 |
commit | 11fce9b705a8b1b514f89661f8d9cb36f56fc296 (patch) | |
tree | 67a96e2336fce4b64d777509a274e03819cb50c4 /embed/mozilla/mozilla-embed-single.cpp | |
parent | 65cedb32fe70cce5d4d55588efa2843dd3027f40 (diff) | |
download | gsoc2013-epiphany-11fce9b705a8b1b514f89661f8d9cb36f56fc296.tar gsoc2013-epiphany-11fce9b705a8b1b514f89661f8d9cb36f56fc296.tar.gz gsoc2013-epiphany-11fce9b705a8b1b514f89661f8d9cb36f56fc296.tar.bz2 gsoc2013-epiphany-11fce9b705a8b1b514f89661f8d9cb36f56fc296.tar.lz gsoc2013-epiphany-11fce9b705a8b1b514f89661f8d9cb36f56fc296.tar.xz gsoc2013-epiphany-11fce9b705a8b1b514f89661f8d9cb36f56fc296.tar.zst gsoc2013-epiphany-11fce9b705a8b1b514f89661f8d9cb36f56fc296.zip |
Initialize mozilla prefs on startup every time. That is necessary if
2003-05-04 Marco Pesenti Gritti <marco@it.gnome.org>
* embed/mozilla/mozilla-embed-single.cpp:
* embed/mozilla/mozilla-notifiers.cpp:
* embed/mozilla/mozilla-notifiers.h:
Initialize mozilla prefs on startup every time. That is necessary
if people change them with gconf-editor. This is a 10 ms regression
on startup but ... it's necessary. What worries me more is the 130 ms
the notifiers registration takes, that's odd.
Diffstat (limited to 'embed/mozilla/mozilla-embed-single.cpp')
-rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 51 |
1 files changed, 6 insertions, 45 deletions
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 355e33583..e752af11e 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -18,6 +18,7 @@ #include "glib.h" #include "ephy-string.h" +#include "ephy-debug.h" #include "gtkmozembed.h" #include "mozilla-embed-single.h" #include "mozilla-prefs.h" @@ -291,41 +292,6 @@ mozilla_init_profile (void) } static gboolean -is_new_build (MozillaEmbedSingle *mes) -{ - gboolean new_build = FALSE; - char *build_test; - char *prefs_file; - - prefs_file = g_build_filename (ephy_dot_dir (), - MOZILLA_PROFILE_DIR, - MOZILLA_PROFILE_NAME, - MOZILLA_PROFILE_FILE, - NULL); - - /* no mozilla prefs ? or new epiphany build */ - build_test = eel_gconf_get_string ("/apps/epiphany/gconf_test"); - if (!g_file_test(mes->priv->user_prefs, G_FILE_TEST_EXISTS) || - build_test == NULL || - strncmp (build_test, __TIME__, 8) != 0) - { - new_build = TRUE; - eel_gconf_set_string ("/apps/epiphany/gconf_test", __TIME__); - } - - g_free (build_test); - - return new_build; -} - -static void -mozilla_init_prefs (MozillaEmbedSingle *mes) -{ - mozilla_set_default_prefs (mes); - mozilla_notifiers_set_defaults (); -} - -static gboolean have_gnome_url_handler (const gchar *protocol) { gchar *key, *cmd; @@ -368,8 +334,6 @@ mozilla_register_external_protocols (void) static void mozilla_embed_single_init (MozillaEmbedSingle *mes) { - gboolean new_build; - mes->priv = g_new0 (MozillaEmbedSinglePrivate, 1); mes->priv->charsets_hash = NULL; mes->priv->sorted_charsets_titles = NULL; @@ -381,24 +345,21 @@ mozilla_embed_single_init (MozillaEmbedSingle *mes) MOZILLA_PROFILE_FILE, NULL); - new_build = is_new_build (mes); - /* Pre initialization */ - mozilla_notifiers_init (EPHY_EMBED_SINGLE (mes)); mozilla_init_home (); mozilla_init_profile (); /* Fire up the best */ gtk_moz_embed_push_startup (); - /* Post initialization */ - if (new_build) - { - mozilla_init_prefs (mes); - } + mozilla_set_default_prefs (mes); mozilla_load_proxy_prefs (mes); + START_PROFILER ("Mozilla prefs notifiers") + mozilla_notifiers_init (EPHY_EMBED_SINGLE (mes)); + STOP_PROFILER ("Mozilla prefs notifiers") + mozilla_init_single (mes); mozilla_register_components (); |