1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-18 06:53:31 +01:00

Fix bookmarks.isBookmark yet again. Check manually, this time.

This commit is contained in:
Kris Maglione
2009-09-26 20:16:13 -04:00
parent 5a0a8dd223
commit adc201f445
3 changed files with 8 additions and 5 deletions

View File

@@ -124,7 +124,7 @@ function Bookmarks() //{{{
return bookmarks.length < length; return bookmarks.length < length;
} }
function findRoot(id) this.findRoot = function findRoot(id)
{ {
do do
{ {
@@ -134,6 +134,8 @@ function Bookmarks() //{{{
return root; return root;
} }
this.isBookmark = function (id) rootFolders.indexOf(self.findRoot(id)) >= 0;
// since we don't use a threaded bookmark loading (by set preload) // since we don't use a threaded bookmark loading (by set preload)
// anymore, is this loading synchronization still needed? --mst // anymore, is this loading synchronization still needed? --mst
let loading = false; let loading = false;
@@ -189,7 +191,7 @@ function Bookmarks() //{{{
// liberator.dump("onItemAdded(" + itemId + ", " + folder + ", " + index + ")\n"); // liberator.dump("onItemAdded(" + itemId + ", " + folder + ", " + index + ")\n");
if (bookmarksService.getItemType(itemId) == bookmarksService.TYPE_BOOKMARK) if (bookmarksService.getItemType(itemId) == bookmarksService.TYPE_BOOKMARK)
{ {
if (rootFolders.indexOf(findRoot(itemId)) >= 0) if (self.isBookmark(itemId))
{ {
let bmark = loadBookmark(readBookmark(itemId)); let bmark = loadBookmark(readBookmark(itemId));
storage.fireEvent(name, "add", bmark); storage.fireEvent(name, "add", bmark);
@@ -606,7 +608,8 @@ function Bookmarks() //{{{
{ {
try try
{ {
return bookmarksService.isBookmarked(util.newURI(url)); return bookmarksService.getBookmarkIdsForURI(makeURI(url), {})
.some(cache.isBookmark);
} }
catch (e) catch (e)
{ {

View File

@@ -173,7 +173,7 @@ function Tabs() //{{{
setter: function (value) setter: function (value)
{ {
let [open, restriction] = [1, 0]; let [open, restriction] = [1, 0];
for (let [, opt] in Iterator(this.parseValue(value))) for (let [, opt] in Iterator(this.parseValues(value)))
{ {
if (opt == "tab") if (opt == "tab")
open = 3; open = 3;

View File

@@ -305,7 +305,7 @@ var observers = {};
var timers = {}; var timers = {};
var storage = { var storage = {
alwaysReload: [], alwaysReload: {},
newObject: function newObject(key, constructor, store, type, options, reload) newObject: function newObject(key, constructor, store, type, options, reload)
{ {
if (!(key in keys) || reload || key in this.alwaysReload) if (!(key in keys) || reload || key in this.alwaysReload)