Bug 161751 Can't switch themes when certain prefs are set r=bsmedberg sr=darin

This commit is contained in:
neil%parkwaycc.co.uk 2005-03-01 09:05:40 +00:00
parent 10c9f68c60
commit 7e4ee2c304

View File

@ -2958,20 +2958,6 @@ nsresult nsChromeRegistry::LoadProfileDataSource()
rv = AddToCompositeDataSource(PR_TRUE);
if (NS_FAILED(rv)) return rv;
// XXX this sucks ASS. This is a temporary hack until we get
// around to fixing the skin switching bugs.
// Select and Remove skins based on a pref set in a previous session.
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefBranch) {
nsXPIDLCString skinToSelect;
rv = prefBranch->GetCharPref("general.skins.selectedSkin", getter_Copies(skinToSelect));
if (NS_SUCCEEDED(rv)) {
rv = SelectSkin(skinToSelect, PR_TRUE);
if (NS_SUCCEEDED(rv))
prefBranch->DeleteBranch("general.skins.selectedSkin");
}
}
// We have to flush the chrome skin cache...
FlushSkinCaches();
}
@ -3288,6 +3274,20 @@ NS_IMETHODIMP nsChromeRegistry::Observe(nsISupports *aSubject, const char *aTopi
if (!mProfileInitialized) {
rv = LoadProfileDataSource();
}
// XXX this sucks ASS. This is a temporary hack until we get
// around to fixing the skin switching bugs.
// Select and Remove skins based on a pref set in a previous session.
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefBranch) {
nsXPIDLCString skinToSelect;
rv = prefBranch->GetCharPref("general.skins.selectedSkin", getter_Copies(skinToSelect));
if (NS_SUCCEEDED(rv)) {
rv = SelectSkin(skinToSelect, PR_TRUE);
if (NS_SUCCEEDED(rv))
prefBranch->DeleteBranch("general.skins.selectedSkin");
}
}
}
return rv;