diff options
| author | Bastien Nocera <hadess@hadess.net> | 2007-03-16 19:09:15 +0800 | 
|---|---|---|
| committer | Bastien Nocera <hadess@src.gnome.org> | 2007-03-16 19:09:15 +0800 | 
| commit | 82443d54ebe1776332e71fbc57ae5b1d85acfe4b (patch) | |
| tree | d52fb131308b900af41a5b131a5f9cf140269548 | |
| parent | af566804b10dafef1ddfd4aafbce3cfa1b69910d (diff) | |
| download | gsoc2013-epiphany-82443d54ebe1776332e71fbc57ae5b1d85acfe4b.tar.gz gsoc2013-epiphany-82443d54ebe1776332e71fbc57ae5b1d85acfe4b.tar.zst gsoc2013-epiphany-82443d54ebe1776332e71fbc57ae5b1d85acfe4b.zip | |
Fix Epiphany not finding some Gecko plugins when running in a multilib
2007-03-16  Bastien Nocera  <hadess@hadess.net>
	* embed/mozilla/Makefile.am:
	* embed/mozilla/mozilla-embed-single.cpp:
	Fix Epiphany not finding some Gecko plugins when
	running in a multilib environment (Closes: #407419)
svn path=/trunk/; revision=6971
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | embed/mozilla/Makefile.am | 1 | ||||
| -rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 79 | 
3 files changed, 75 insertions, 12 deletions
| @@ -1,3 +1,10 @@ +2007-03-16  Bastien Nocera  <hadess@hadess.net> + +	* embed/mozilla/Makefile.am: +	* embed/mozilla/mozilla-embed-single.cpp: +	Fix Epiphany not finding some Gecko plugins when +	running in a multilib environment (Closes: #407419) +  2007-03-12  Christian Persch  <chpe@gnome.org>  	* embed/mozilla/GtkNSSDialogs.cpp: diff --git a/embed/mozilla/Makefile.am b/embed/mozilla/Makefile.am index e63cf43a8..8636d88a9 100644 --- a/embed/mozilla/Makefile.am +++ b/embed/mozilla/Makefile.am @@ -144,6 +144,7 @@ libephymozillaembed_la_CPPFLAGS = \  	-DPLUGINDIR=\"$(libdir)/epiphany/$(EPIPHANY_MAJOR)/plugins\"		\  	-DMOZILLA_HOME=\"$(MOZILLA_HOME)\"	\  	-DMOZILLA_PREFIX=\"$(MOZILLA_PREFIX)\"	\ +	-DMOZILLA_NATIVE_PLUGINSDIR=\"$(libdir)/mozilla/plugins\"		\  	-DUA_VERSION=\"$(EPIPHANY_UA_VERSION)\"	\  	-DALLOW_PRIVATE_API			\  	$(AM_CPPFLAGS) diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 05b066408..3c236655f 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -312,24 +312,79 @@ mozilla_embed_single_new_window_orphan_cb (GtkMozEmbedSingle *moz_single,  	}  } +static GList * +mozilla_init_plugin_add_unique_path (GList *list, +				     const char *path) +{ +	GList *l; +	char *canon; + +	if (path == NULL) +		return list; + +	canon = gnome_vfs_make_path_name_canonical (path); +	for (l = list; l != NULL; l = l->next) { +		if (g_str_equal (list->data, canon) != FALSE) { +			/* The path is already in the list */ +			g_free (canon); +			return list; +		} +	} +	return g_list_prepend (list, canon); +} + +static GList * +mozilla_init_plugin_add_unique_paths (GList *list, +				      const char *path) +{ +	char **paths; +	guint i; + +	if (path == NULL) +		return list; + +	paths = g_strsplit (path, ":", -1); +	if (paths == NULL) +		return list; +	for (i = 0; paths[i] != NULL; i++) { +		list = mozilla_init_plugin_add_unique_path (list, paths[i]); +	} +	g_strfreev (paths); +	return list; +} +  static void  mozilla_init_plugin_path ()  { -	const char *user_path; -	char *new_path; - -	user_path = g_getenv ("MOZ_PLUGIN_PATH"); -	new_path = g_strconcat (user_path ? user_path : "", -				user_path ? ":" : "", -				MOZILLA_PREFIX "/lib/mozilla/plugins" -				":" MOZILLA_HOME "/plugins", +	GList *list, *l; +	GString *path; + +	list = NULL; +	list = mozilla_init_plugin_add_unique_paths (list, +						     g_getenv ("MOZ_PLUGIN_PATH")); +	list = mozilla_init_plugin_add_unique_path (list, +						    MOZILLA_PREFIX "/lib/mozilla/plugins"); +	list = mozilla_init_plugin_add_unique_path (list, +						    MOZILLA_HOME "/plugins"); +	list = mozilla_init_plugin_add_unique_path (list, +						    MOZILLA_NATIVE_PLUGINSDIR);  #ifdef HAVE_PRIVATE_PLUGINS -				":" PLUGINDIR, +	list = mozilla_init_plugin_add_unique_path (list, PLUGINDIR);  #endif -				(char *) NULL); -	g_setenv ("MOZ_PLUGIN_PATH", new_path, TRUE); -	g_free (new_path); +	list = g_list_reverse (list); +	path = g_string_new ((const char *) list->data); +	g_free (list->data); +	l = list->next; +	for (; l != NULL; l = l->next) { +		path = g_string_append_c (path, ':'); +		path = g_string_append (path, (const char *) l->data); +		g_free (l->data); +	} +	g_list_free (list); + +	g_setenv ("MOZ_PLUGIN_PATH", path->str, TRUE); +	g_string_free (path, TRUE);  }  static void | 
