зеркало из https://github.com/mozilla/pjs.git
Fixing bug 227257, top ten list should exclude the bookmarks manager page (about:bookmarks) and histroy (about:history). Patch by froodian <stridey@gmail.com>, r=smorgan, sr=pink.
This commit is contained in:
Родитель
469a179e65
Коммит
e7b0bd475e
|
@ -147,7 +147,6 @@ const unsigned kNumTop10Items = 10; // well, 10, duh!
|
|||
|
||||
// NSLog(@"checkForNewTop10 %@ (%d items)", aBookmark, [top10ItemsArray count]);
|
||||
|
||||
// if it's already in the list
|
||||
unsigned curIndex = [top10ItemsArray indexOfObjectIdenticalTo:aBookmark];
|
||||
unsigned visitCount = [aBookmark numberOfVisits];
|
||||
|
||||
|
@ -179,12 +178,18 @@ const unsigned kNumTop10Items = 10; // well, 10, duh!
|
|||
}
|
||||
else if (visitCount >= currentMinVisits)
|
||||
{
|
||||
// If bookmark is an about:URI, ignore it
|
||||
NSString* newItemURL = [aBookmark url];
|
||||
NSRange firstColon = [newItemURL rangeOfString:@":"];
|
||||
// If there's a colon in the URI and everything up to it is "about", return
|
||||
if((firstColon.location != NSNotFound) && [[newItemURL substringToIndex:firstColon.location] isEqual:@"about"])
|
||||
return;
|
||||
|
||||
// enter it into the list using insertion sort. it will go before other items with the same visit
|
||||
// count (thus maintaining the visit count/last visit sort).
|
||||
unsigned numItems = [top10ItemsArray count];
|
||||
int insertionIndex = -1;
|
||||
|
||||
NSString* newItemURL = [aBookmark url];
|
||||
NSNumber* reverseSort = [NSNumber numberWithBool:YES];
|
||||
|
||||
// we check the entire list to look for items with a duplicate url
|
||||
|
|
Загрузка…
Ссылка в новой задаче