зеркало из https://github.com/mozilla/pjs.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:
Родитель
38729def2c
Коммит
e6d7762c44
|
@ -220,14 +220,23 @@ nsSHistory::Startup()
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||||
if (prefs) {
|
if (prefs) {
|
||||||
// Session history size is only taken from the default prefs branch.
|
nsCOMPtr<nsIPrefBranch> sesHBranch;
|
||||||
// This means that it's only configurable on a per-application basis.
|
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
|
// 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;
|
nsCOMPtr<nsIPrefBranch> defaultBranch;
|
||||||
prefs->GetDefaultBranch(nsnull, getter_AddRefs(defaultBranch));
|
prefs->GetDefaultBranch(nsnull, getter_AddRefs(defaultBranch));
|
||||||
if (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,
|
// Allow the user to override the max total number of cached viewers,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче