Bug 343784 home page not migrated r=mconnor

This commit is contained in:
masayuki%d-toybox.com 2006-08-18 08:29:33 +00:00
Родитель c15fab5d8b
Коммит bce8d33648
1 изменённых файлов: 9 добавлений и 2 удалений

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

@ -467,14 +467,21 @@ var MigrationWizard = {
if (this._newHomePage) {
try {
// set homepage properly
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var prefBranch = prefSvc.getBranch(null);
var str = Components.classes["@mozilla.org/supports-string;1"]
.createInstance(Components.interfaces.nsISupportsString);
str.data = this._newHomePage;
prefBranch.setComplexValue("browser.startup.homepage",
Components.interfaces.nsISupportsString,
str);
var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
var prefFile = dirSvc.get("ProfDS", Components.interfaces.nsIFile);
prefFile.append("prefs.js");
prefSvc.savePrefFile(prefFile);
} catch(ex) {
dump(ex);
}