Preferences

Discuss building things with or for the Mozilla Platform.
Post Reply
Ilich
Posts: 1
Joined: May 20th, 2003, 4:11 am
Contact:

Preferences

Post by Ilich »

Hello.
I have following problem. I need to get preferences of current profile.
Here is the code I wrote:

nsCOMPtr<nsIPrefService> prefService =
do_GetService(NS_PREFSERVICE_CONTRACTID);

if(prefService)
{
nsCOMPtr<nsIPrefBranch> prefBranch;
rv = prefService->GetBranch("network.proxy.",
getter_AddRefs(prefBranch));
if(NS_SUCCEEDED(rv))
{
char* sStr;
rv = prefBranch->GetCharPref("http", &sStr);
}
else {...}
}
else {...}

This code get preferences from C:\program files\Netscape\defaults\pref\all.js
but these preferences are not of current profile.
What shall i do?
User avatar
martind
Posts: 432
Joined: May 17th, 2003, 2:01 pm
Location: Berlin, Germany
Contact:

Post by martind »

In case nobody can answer your question I suggest that you simply take a small extension that stores preferences in the user profile and look at the code.
Post Reply