diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-15 10:22:26 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-15 10:22:26 (GMT) |
commit | ef00d72ca806e53063a7834679833a906e12bcb0 (patch) | |
tree | f99a146159c9bb4b28108ab4586828ad83c8e84f /browser/sugar-browser.cpp | |
parent | 4a8493f95e4df95cfbdb0705c146342f4b8cab58 (diff) |
Put compreg.dat in the profile.
Diffstat (limited to 'browser/sugar-browser.cpp')
-rw-r--r-- | browser/sugar-browser.cpp | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/browser/sugar-browser.cpp b/browser/sugar-browser.cpp index d5644da..2cee6d2 100644 --- a/browser/sugar-browser.cpp +++ b/browser/sugar-browser.cpp @@ -148,17 +148,9 @@ setup_plugin_path () g_free (new_path); } -gboolean -sugar_browser_startup(const char *profile_path, const char *profile_name) +static gboolean +setup_directory_provider(const char *full_prof_path) { - nsresult rv; - - setup_plugin_path(); - - gtk_moz_embed_set_profile_path(profile_path, profile_name); - - old_handler = XSetErrorHandler(error_handler); - const char *prefix = g_getenv("SUGAR_PREFIX"); if (prefix == NULL) { g_print("The SUGAR_PREFIX environment variable is not set."); @@ -168,14 +160,14 @@ sugar_browser_startup(const char *profile_path, const char *profile_name) char *components_path = g_build_filename(prefix, "share/sugar", NULL); GeckoDirectoryProvider *dirProvider = - new GeckoDirectoryProvider(components_path); + new GeckoDirectoryProvider(components_path, full_prof_path); if (!dirProvider) { g_warning ("failed to create GeckoDirectoryProvider"); return FALSE; } g_free(components_path); - + NS_ADDREF (dirProvider); nsCOMPtr<nsIDirectoryServiceProvider> dp (do_QueryInterface (dirProvider)); @@ -185,6 +177,26 @@ sugar_browser_startup(const char *profile_path, const char *profile_name) if (!dp) return FALSE; gtk_moz_embed_set_directory_service_provider(dp); + + return TRUE; +} + +gboolean +sugar_browser_startup(const char *profile_path, const char *profile_name) +{ + nsresult rv; + + setup_plugin_path(); + + gtk_moz_embed_set_profile_path(profile_path, profile_name); + + old_handler = XSetErrorHandler(error_handler); + + char *full_prof_path = g_build_filename(profile_path, profile_name, NULL); + if (!setup_directory_provider(full_prof_path)) { + return FALSE; + } + g_free(full_prof_path); gtk_moz_embed_push_startup(); |