Bug 284521 Still can't switch themes, but in a different set of circumstances, so check the skin switch pref in more places. r=bsmedberg sr=darin

git-svn-id: svn://10.0.0.236/trunk@170938 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
neil%parkwaycc.co.uk 2005-03-21 10:46:46 +00:00
parent 9ce318c9bc
commit a4a4f8da95

View File

@ -2958,6 +2958,20 @@ 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();
}
@ -3271,23 +3285,7 @@ NS_IMETHODIMP nsChromeRegistry::Observe(nsISupports *aSubject, const char *aTopi
FlushAllCaches();
}
else if (!strcmp("profile-after-change", aTopic)) {
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");
}
}
rv = LoadProfileDataSource();
}
return rv;