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
Родитель 9e3e18da7b
Коммит d78747d0be
2 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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