@ -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 BG _EPDQI _runBatched ( ) {