From 6e9a8c6fbb18b2a279a88c2121feefdf4ece5bf1 Mon Sep 17 00:00:00 2001 From: "edward.lee@engineering.uiuc.edu" Date: Wed, 20 Feb 2008 17:38:38 -0800 Subject: [PATCH] Bug 417810 - Frequently Visited Pages Disappear From Location Bar Autocomplete. r=dietrich, b-ff3=beltzner --- browser/app/profile/firefox.js | 6 +++--- toolkit/components/places/src/nsNavHistory.cpp | 3 ++- toolkit/components/places/tests/unit/test_000_frecency.js | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 5b1a3c3b7bc..53a503091e7 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -668,9 +668,9 @@ pref("places.frecency.defaultBucketWeight", 10); // bonus (in percent) for visit transition types for frecency calculations pref("places.frecency.embedVisitBonus", 0); -pref("places.frecency.linkVisitBonus", 120); -pref("places.frecency.typedVisitBonus", 200); -pref("places.frecency.bookmarkVisitBonus", 140); +pref("places.frecency.linkVisitBonus", 100); +pref("places.frecency.typedVisitBonus", 500); +pref("places.frecency.bookmarkVisitBonus", 150); pref("places.frecency.downloadVisitBonus", 0); pref("places.frecency.permRedirectVisitBonus", 0); pref("places.frecency.tempRedirectVisitBonus", 0); diff --git a/toolkit/components/places/src/nsNavHistory.cpp b/toolkit/components/places/src/nsNavHistory.cpp index e2bc59d07dd..3ae0faf1fd4 100644 --- a/toolkit/components/places/src/nsNavHistory.cpp +++ b/toolkit/components/places/src/nsNavHistory.cpp @@ -5906,7 +5906,8 @@ nsNavHistory::UpdateFrecency(PRInt64 aPlaceId, PRBool aIsBookmarked) // On refresh, when we remove and then add the livemark items, // the frecency (for a given moz_places) will not have changed // (if we've never visited that place). - if (newFrecency == oldFrecency) + // Additionally, don't bother overwriting a valid frecency with -1 + if (newFrecency == oldFrecency || oldFrecency && newFrecency == -1) return NS_OK; mozStorageStatementScoper updateScoper(mDBUpdateFrecencyAndHidden); diff --git a/toolkit/components/places/tests/unit/test_000_frecency.js b/toolkit/components/places/tests/unit/test_000_frecency.js index b54dac5bb32..cccd2713c1a 100644 --- a/toolkit/components/places/tests/unit/test_000_frecency.js +++ b/toolkit/components/places/tests/unit/test_000_frecency.js @@ -167,6 +167,8 @@ bucketPrefs.every(function(bucket) { // sort results by frecency results.sort(function(a,b) a[1] - b[1]); results.reverse(); +// Make sure there's enough results returned +prefs.setIntPref("browser.urlbar.maxRichResults", results.length); //results.every(function(el) { dump("result: " + el[1] + ": " + el[0].spec + " (" + el[2] + ")\n"); return true; })