Bug 244009 - implement profile preferences for EM (backend work for directoryservice preferences list) Migrating patch from aviary1.0 branch, r=me sr=darin

git-svn-id: svn://10.0.0.236/trunk@157847 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bsmedberg%covad.net
2004-06-14 05:55:13 +00:00
parent 63df9d4db0
commit e01526b177
2 changed files with 24 additions and 0 deletions

View File

@@ -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<nsIProperties> dirSvc(do_GetService(kDirectoryServiceCID, &rv));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsISimpleEnumerator> 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<nsISupports> elem;
dirList->GetNext(getter_AddRefs(elem));
if (elem) {
nsCOMPtr<nsIFile> 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;
}

View File

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