diff --git a/mozilla/modules/libpref/src/nsPrefService.cpp b/mozilla/modules/libpref/src/nsPrefService.cpp index f0eee745469..5940c4343b8 100644 --- a/mozilla/modules/libpref/src/nsPrefService.cpp +++ b/mozilla/modules/libpref/src/nsPrefService.cpp @@ -785,6 +785,29 @@ static nsresult pref_InitInitialObjects() // xxxbsmedberg: TODO load default prefs from a category // but the architecture is not quite there yet + static NS_DEFINE_CID(kDirectoryServiceCID, NS_DIRECTORY_SERVICE_CID); + nsCOMPtr dirSvc(do_GetService(kDirectoryServiceCID, &rv)); + if (NS_FAILED(rv)) return rv; + + nsCOMPtr dirList; + dirSvc->Get(NS_APP_PREFS_DEFAULTS_DIR_LIST, + NS_GET_IID(nsISimpleEnumerator), + getter_AddRefs(dirList)); + if (dirList) { + PRBool hasMore; + while (NS_SUCCEEDED(dirList->HasMoreElements(&hasMore)) && hasMore) { + nsCOMPtr elem; + dirList->GetNext(getter_AddRefs(elem)); + if (elem) { + nsCOMPtr dir = do_QueryInterface(elem); + if (dir) { + // Do we care if a file provided by this process fails to load? + pref_LoadPrefsInDir(dir, nsnull, 0); + } + } + } + } + return NS_OK; } diff --git a/mozilla/xpcom/io/nsAppDirectoryServiceDefs.h b/mozilla/xpcom/io/nsAppDirectoryServiceDefs.h index 59b1f1584ec..3887f0105b0 100755 --- a/mozilla/xpcom/io/nsAppDirectoryServiceDefs.h +++ b/mozilla/xpcom/io/nsAppDirectoryServiceDefs.h @@ -92,6 +92,7 @@ #define NS_APP_PREFS_50_DIR "PrefD" // Directory which contains user prefs #define NS_APP_PREFS_50_FILE "PrefF" +#define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL" #define NS_APP_USER_PROFILE_50_DIR "ProfD"