Migrate network.image.imageBehavior to permissions.default.image. Bug 300916,

patch by Frank Wein <bugzilla@mcsmurf.de>, r=mconnor
This commit is contained in:
bzbarsky%mit.edu 2005-09-16 20:14:09 +00:00
Родитель 36bcedf05d
Коммит 19773c8da0
4 изменённых файлов: 10 добавлений и 10 удалений

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

@ -417,7 +417,7 @@ nsDogbertProfileMigrator::PrefTransform gTransforms[] = {
{ "browser.use_document.fonts", "browser.display.use_document_fonts", F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "browser.link_expiration", "browser.history_expire_days", F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "browser.startup.page", "browser.startup.homepage", F(GetHomepage), F(SetWStringFromASCII), PR_FALSE, -1 },
{ "general.always_load_images", "network.image.imageBehavior", F(GetImagePref),F(SetInt), PR_FALSE, -1 },
{ "general.always_load_images", "permissions.default.image", F(GetImagePref),F(SetInt), PR_FALSE, -1 },
};
nsresult
@ -493,7 +493,7 @@ nsDogbertProfileMigrator::GetImagePref(void* aTransform, nsIPrefBranch* aBranch)
PRBool loadImages;
nsresult rv = aBranch->GetBoolPref(xform->sourcePrefName, &loadImages);
if (NS_SUCCEEDED(rv)) {
xform->intValue = loadImages ? 0 : 2;
xform->intValue = loadImages ? 1 : 2;
xform->prefHasValue = PR_TRUE;
}
return rv;

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

@ -155,7 +155,7 @@ TranslateYNtoImageBehavior(unsigned char *aRegValue, DWORD aRegValueLength,
if (aRegValueType == REG_SZ && aRegValue[0] != 0) {
// strcmp is safe; it's bounded by its second parameter
if (!strcmp(NS_REINTERPRET_CAST(char *, aRegValue), "yes"))
prefs->SetIntPref(aPrefKeyName, 0);
prefs->SetIntPref(aPrefKeyName, 1);
else
prefs->SetIntPref(aPrefKeyName, 2);
}
@ -361,7 +361,7 @@ struct regEntry gRegEntries[] = {
TranslateYNtoTF },
{ 0,
"Display Inline Images",
"network.image.imageBehavior",
"permissions.default.image",
TranslateYNtoImageBehavior },
{ 0,
"Enable AutoImageResize",

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

@ -295,7 +295,7 @@ nsOperaProfileMigrator::PrefTransform gTransforms[] = {
{ nsnull, "Allow script to change status", _OPM(BOOL), "dom.disable_window_status_change", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Home URL", _OPM(STRING), "browser.startup.homepage", _OPM(SetWString), PR_FALSE, -1 },
{ nsnull, "Ignore Unrequested Popups", _OPM(BOOL), "dom.disable_open_during_load", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Load Figures", _OPM(BOOL), "network.image.imageBehavior", _OPM(SetImageBehavior), PR_FALSE, -1 },
{ nsnull, "Load Figures", _OPM(BOOL), "permissions.default.image", _OPM(SetImageBehavior), PR_FALSE, -1 },
{ "Visited link", nsnull, _OPM(COLOR), "browser.visited_color", _OPM(SetString), PR_FALSE, -1 },
{ "Link", nsnull, _OPM(COLOR), "browser.anchor_color", _OPM(SetString), PR_FALSE, -1 },
@ -330,7 +330,7 @@ nsresult
nsOperaProfileMigrator::SetImageBehavior(void* aTransform, nsIPrefBranch* aBranch)
{
PrefTransform* xform = (PrefTransform*)aTransform;
return aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 0 : 2);
return aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 1 : 2);
}
nsresult

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

@ -342,7 +342,7 @@ nsSafariProfileMigrator::PrefTransform gTransforms[] = {
{ CFSTR("WebKitFixedFont"), _SPM(STRING), "font.name.fixed.", _SPM(SetFontName), PR_FALSE, -1 },
{ CFSTR("WebKitDefaultFixedFontSize"), _SPM(INT), "font.size.fixed.", _SPM(SetFontSize), PR_FALSE, -1 },
{ CFSTR("WebKitMinimumFontSize"), _SPM(INT), "font.minimum-size.", _SPM(SetFontSize), PR_FALSE, -1 },
{ CFSTR("WebKitDisplayImagesKey"), _SPM(BOOL), "network.image.imageBehavior", _SPM(SetDisplayImages), PR_FALSE, -1 },
{ CFSTR("WebKitDisplayImagesKey"), _SPM(BOOL), "permissions.default.image", _SPM(SetDisplayImages), PR_FALSE, -1 },
{ CFSTR("WebKitJavaEnabled"), _SPM(BOOL), "security.enable_java", _SPM(SetBool), PR_FALSE, -1 },
{ CFSTR("WebKitJavaScriptEnabled"), _SPM(BOOL), "javascript.enabled", _SPM(SetBool), PR_FALSE, -1 },
{ CFSTR("WebKitJavaScriptCanOpenWindowsAutomatically"),
@ -614,10 +614,10 @@ nsSafariProfileMigrator::SetDisplayImages(void* aTransform, nsIPrefBranch* aBran
// Firefox has an elaborate set of Image preferences. The correlation is:
// Mode: Safari Firefox
// Blocked FALSE 2
// Allowed TRUE 0
// Allowed, originating site only -- 1
// Allowed TRUE 1
// Allowed, originating site only -- 3
PrefTransform* xform = (PrefTransform*)aTransform;
aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 0 : 2);
aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 1 : 2);
return NS_OK;
}