Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 6a625b0f07fb60ad294dd6d75ff14172 > files > 1

evolution-rss-0.1.0-6.2mdv2009.0.src.rpm

diff -Nur evolution-rss-0.1.0/src/gecko-utils.cpp evolution-rss-0.1.0.new/src/gecko-utils.cpp
--- evolution-rss-0.1.0/src/gecko-utils.cpp	2008-07-02 08:45:07.000000000 +0200
+++ evolution-rss-0.1.0.new/src/gecko-utils.cpp	2008-07-04 11:35:57.000000000 +0200
@@ -27,6 +27,11 @@
 
 #include <nsStringAPI.h>
 
+#ifdef XPCOM_GLUE
+#include <nsXPCOMGlue.h>
+#include <gtkmozembed_glue.cpp>
+#endif
+
 #ifdef HAVE_GECKO_1_9
 #include <gtkmozembed.h>
 #include <gtkmozembed_internal.h>
@@ -72,16 +77,58 @@
 #ifdef HAVE_GECKO_1_9
 	NS_LogInit ();
 #endif
-	
+
+	nsresult rv;
+#ifdef XPCOM_GLUE
+	static const GREVersionRange greVersion = {
+	  "1.9a", PR_TRUE,
+	  "1.9.*", PR_TRUE
+	};
+	char xpcomLocation[4096];
+	rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, xpcomLocation, 4096);
+	if (NS_FAILED (rv))
+	{
+	  g_warning ("Could not determine locale!\n");
+	  return FALSE;
+	}
+
+	// Startup the XPCOM Glue that links us up with XPCOM.
+	rv = XPCOMGlueStartup(xpcomLocation);
+	if (NS_FAILED (rv))
+	{
+	  g_warning ("Could not determine locale!\n");
+	  return FALSE;
+	}
+
+	rv = GTKEmbedGlueStartup();
+	if (NS_FAILED (rv))
+	{
+	  g_warning ("Could not startup glue!\n");
+	  return FALSE;
+	}
+
+	rv = GTKEmbedGlueStartupInternal();
+	if (NS_FAILED (rv))
+	{
+	  g_warning ("Could not startup internal glue!\n");
+	  return FALSE;
+	}
+
+	char *lastSlash = strrchr(xpcomLocation, '/');
+	if (lastSlash)
+	  *lastSlash = '\0';
+
+	gtk_moz_embed_set_path(xpcomLocation);
+#else
 #ifdef HAVE_GECKO_1_9
 	gtk_moz_embed_set_path (GECKO_HOME);
 #else
 	gtk_moz_embed_set_comp_path (GECKO_HOME);
 #endif
+#endif /* XPCOM_GLUE */
 
 	gtk_moz_embed_push_startup ();
 
-	nsresult rv;
 	nsCOMPtr<nsIPrefService> prefService (do_GetService (NS_PREFSERVICE_CONTRACTID, &rv));
 	NS_ENSURE_SUCCESS (rv, FALSE);