Bug 556644 - 5. Enumerate prefs in the omnijar, r=bsmedberg a=blocking2.0

This commit is contained in:
Michael Wu 2010-08-11 18:10:11 -07:00
parent d83c01b1fa
commit f90f4f45dd
2 changed files with 14 additions and 3 deletions

View File

@ -156,8 +156,6 @@ dist: FORCE
$(NSINSTALL) -D dist/defaults
rm -rf dist/defaults/*
@(for f in $(DIST)/bin/defaults/* ; do $(NSINSTALL) $$f dist/defaults ; done )
@(for PREF in $(DIST)/bin/defaults/pref/*.js ; do cat "$$PREF" >> dist/defaults/prefs.js ; echo >> dist/defaults/prefs.js ; done )
rm -rf dist/defaults/pref
@(for f in $(DIST_LINK_FILES) ; do if [ -e $(DIST)/bin/$$f ] ; then echo $$f ; ln -sf ../$(DIST)/bin/$$f dist ; fi ; done)
gecko-unsigned-unaligned.apk: gecko.ap_ classes.dex dist $(FULL_LIBS)

View File

@ -768,9 +768,22 @@ static nsresult pref_InitAppDefaultsFromOmnijar()
rv = pref_ReadPrefFromJar(jarReader, "greprefs.js");
NS_ENSURE_SUCCESS(rv, rv);
rv = pref_ReadPrefFromJar(jarReader, "defaults/prefs.js");
nsZipFind *findPtr;
rv = jarReader->FindInit("defaults/pref/*.js$", &findPtr);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoPtr<nsZipFind> find(findPtr);
nsCAutoString prefName;
const char *entryName;
PRUint16 entryNameLen;
while (NS_SUCCEEDED(find->FindNext(&entryName, &entryNameLen))) {
prefName = nsDependentCSubstring(entryName, entryName + entryNameLen);
rv = pref_ReadPrefFromJar(jarReader, prefName.get());
if (NS_FAILED(rv))
NS_WARNING("Error parsing preferences.");
}
return NS_OK;
}
#endif