From 5e35786794643e4cfd9b0731bbaa5a1d231b14a0 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Mon, 30 Aug 2010 16:37:08 -0700 Subject: [PATCH] Bug 591866 - channel-prefs.js should not be in omni.jar, r=bsmedberg a=blocking-beta5 --- browser/installer/removed-files.in | 1 - modules/libpref/src/nsPrefService.cpp | 18 ++++++++++++++++++ toolkit/mozapps/installer/packager.mk | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/browser/installer/removed-files.in b/browser/installer/removed-files.in index d8666aa0f140..edd016e2fc20 100644 --- a/browser/installer/removed-files.in +++ b/browser/installer/removed-files.in @@ -626,7 +626,6 @@ xpicleanup@BIN_SUFFIX@ components/WebContentConverter.js defaults/autoconfig/platform.js defaults/autoconfig/prefcalls.js - defaults/pref/channel-prefs.js defaults/pref/firefox-branding.js defaults/pref/firefox.js defaults/pref/firefox-l10n.js diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefService.cpp index 13c924c85b18..488d0e63a7e2 100644 --- a/modules/libpref/src/nsPrefService.cpp +++ b/modules/libpref/src/nsPrefService.cpp @@ -784,6 +784,24 @@ static nsresult pref_InitAppDefaultsFromOmnijar() NS_WARNING("Error parsing preferences."); } + nsCOMPtr file; + // Bug 591866 - channel-prefs.js should not be in omni.jar + rv = NS_GetSpecialDirectory(NS_APP_PREF_DEFAULTS_50_DIR, getter_AddRefs(file)); + if (NS_FAILED(rv)) { + NS_WARNING("Error getting default prefs dir"); + return NS_OK; + } + + rv = file->AppendNative(NS_LITERAL_CSTRING("channel-prefs.js")); + if (NS_FAILED(rv)) { + NS_WARNING("Error setting channel-prefs.js path"); + return NS_OK; + } + + rv = openPrefFile(file); + if (NS_FAILED(rv)) + NS_WARNING("Error reading channel-prefs.js"); + return NS_OK; } #endif diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk index b03574bb0cb7..945112274728 100644 --- a/toolkit/mozapps/installer/packager.mk +++ b/toolkit/mozapps/installer/packager.mk @@ -229,6 +229,7 @@ OMNIJAR_FILES = \ NON_OMNIJAR_FILES = \ chrome/icons/\* \ + defaults/pref/channel-prefs.js \ res/cursors/\* \ res/MainMenu.nib/\* \ $(NULL)