зеркало из https://github.com/mozilla/gecko-dev.git
Bug 197466 - "Back button (session history) has 50 entries regardless of setting in prefs.js" [p=zug_treno@yahoo.com r+sr=bzbarsky a1.9=damons]
This commit is contained in:
Родитель
f8e72c6c72
Коммит
851a344036
|
@ -220,14 +220,23 @@ nsSHistory::Startup()
|
|||
{
|
||||
nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
if (prefs) {
|
||||
// Session history size is only taken from the default prefs branch.
|
||||
// This means that it's only configurable on a per-application basis.
|
||||
nsCOMPtr<nsIPrefBranch> sesHBranch;
|
||||
prefs->GetBranch(nsnull, getter_AddRefs(sesHBranch));
|
||||
if (sesHBranch) {
|
||||
sesHBranch->GetIntPref(PREF_SHISTORY_SIZE, &gHistoryMaxSize);
|
||||
}
|
||||
|
||||
// The goal of this is to unbreak users who have inadvertently set their
|
||||
// session history size to -1.
|
||||
// session history size to less than the default value.
|
||||
PRInt32 defaultHistoryMaxSize = 50;
|
||||
nsCOMPtr<nsIPrefBranch> defaultBranch;
|
||||
prefs->GetDefaultBranch(nsnull, getter_AddRefs(defaultBranch));
|
||||
if (defaultBranch) {
|
||||
defaultBranch->GetIntPref(PREF_SHISTORY_SIZE, &gHistoryMaxSize);
|
||||
defaultBranch->GetIntPref(PREF_SHISTORY_SIZE, &defaultHistoryMaxSize);
|
||||
}
|
||||
|
||||
if (gHistoryMaxSize < defaultHistoryMaxSize) {
|
||||
gHistoryMaxSize = defaultHistoryMaxSize;
|
||||
}
|
||||
|
||||
// Allow the user to override the max total number of cached viewers,
|
||||
|
|
Загрузка…
Ссылка в новой задаче