Fix mozilla components loading when sugar is running from source.

We don't attempt to load components from source, since that would
be insanely complicated.
This commit is contained in:
Marco Pesenti Gritti 2007-05-15 11:50:21 +02:00
parent 9fa0790c2b
commit 4a8493f95e
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,4 @@
export SUGAR_PREFIX=@prefix@
export SUGAR_PATH=@prefix@/share/sugar export SUGAR_PATH=@prefix@/share/sugar
export GTK2_RC_FILES=@prefix@/share/sugar/data/sugar-xo.gtkrc export GTK2_RC_FILES=@prefix@/share/sugar/data/sugar-xo.gtkrc
dbus-launch --exit-with-session sugar-shell dbus-launch --exit-with-session sugar-shell

View File

@ -159,13 +159,23 @@ sugar_browser_startup(const char *profile_path, const char *profile_name)
old_handler = XSetErrorHandler(error_handler); 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.");
exit(1);
}
char *components_path = g_build_filename(prefix, "share/sugar", NULL);
GeckoDirectoryProvider *dirProvider = GeckoDirectoryProvider *dirProvider =
new GeckoDirectoryProvider(g_getenv(SUGAR_PATH)); new GeckoDirectoryProvider(components_path);
if (!dirProvider) { if (!dirProvider) {
g_warning ("failed to create GeckoDirectoryProvider"); g_warning ("failed to create GeckoDirectoryProvider");
return FALSE; return FALSE;
} }
g_free(components_path);
NS_ADDREF (dirProvider); NS_ADDREF (dirProvider);
nsCOMPtr<nsIDirectoryServiceProvider> dp (do_QueryInterface (dirProvider)); nsCOMPtr<nsIDirectoryServiceProvider> dp (do_QueryInterface (dirProvider));

View File

@ -22,7 +22,7 @@ def _get_prefix_path(base, path=None):
if os.environ.has_key('SUGAR_PREFIX'): if os.environ.has_key('SUGAR_PREFIX'):
prefix = os.environ['SUGAR_PREFIX'] prefix = os.environ['SUGAR_PREFIX']
else: else:
prefix = '/usr' raise RuntimeError("The SUGAR_PREFIX environment variable is not set.")
if path: if path:
return os.path.join(prefix, base, path) return os.path.join(prefix, base, path)