summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathenian200 <athenian200@outlook.com>2020-02-08 09:51:49 -0600
committerathenian200 <athenian200@outlook.com>2020-02-08 09:51:49 -0600
commitbfdf9295fbd034ea09a94f62bc3bd0305bc915c1 (patch)
tree6fd3359c6b1976bcc630691a2a2f43e7d42f644a
parente48dabc8b0226c62d91161b692e3d758beaccc95 (diff)
parent5b28a93fad9173fa888f71f84e122ff99e7d822c (diff)
downloadpalemoon-bfdf9295fbd034ea09a94f62bc3bd0305bc915c1.tar.gz
Merge branch 'master' of http://github.com/MoonchildProductions/Pale-Moon into function-syntax
-rw-r--r--palemoon/components/nsBrowserGlue.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/palemoon/components/nsBrowserGlue.js b/palemoon/components/nsBrowserGlue.js
index e23f37530..081c26065 100644
--- a/palemoon/components/nsBrowserGlue.js
+++ b/palemoon/components/nsBrowserGlue.js
@@ -1585,18 +1585,29 @@ BrowserGlue.prototype = {
const SMART_BOOKMARKS_VERSION = 4;
const SMART_BOOKMARKS_ANNO = "Places/SmartBookmark";
const SMART_BOOKMARKS_PREF = "browser.places.smartBookmarksVersion";
+ const SMART_BOOKMARKS_MAX_PREF = "browser.places.smartBookmarks.max";
+ const SMART_BOOKMARKS_OLDMAX_PREF = "browser.places.smartBookmarks.old-max";
- // TODO bug 399268: should this be a pref?
- const MAX_RESULTS = 10;
+ const MAX_RESULTS = Services.prefs.getIntPref(SMART_BOOKMARKS_MAX_PREF, 10);
+ let OLD_MAX_RESULTS = Services.prefs.getIntPref(SMART_BOOKMARKS_OLDMAX_PREF, 10);
// Get current smart bookmarks version. If not set, create them.
let smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF, 0);
- // If version is current or smart bookmarks are disabled, just bail out.
+ // If version is current and max hasn't changed or smart bookmarks are disabled, just bail out.
if (smartBookmarksCurrentVersion == -1 ||
- smartBookmarksCurrentVersion >= SMART_BOOKMARKS_VERSION) {
+ (smartBookmarksCurrentVersion >= SMART_BOOKMARKS_VERSION &&
+ OLD_MAX_RESULTS == MAX_RESULTS)) {
return;
}
+
+ // We're going to recreate the smart bookmarks and set the current max, so store it.
+ if (Services.prefs.prefHasUserValue(SMART_BOOKMARKS_MAX_PREF)) {
+ Services.prefs.setIntPref(SMART_BOOKMARKS_OLDMAX_PREF, MAX_RESULTS);
+ } else {
+ // The max value is default, no need to track the temp value.
+ Services.prefs.clearUserPref(SMART_BOOKMARKS_OLDMAX_PREF);
+ }
let batch = {
runBatched: function() {