diff options
author | Kris Maglione <jg@suckless.org> | 2009-09-26 20:16:13 -0400 |
---|---|---|
committer | Kris Maglione <jg@suckless.org> | 2009-09-26 20:16:13 -0400 |
commit | adc201f4454aabb9fbca693094394af114b639bc (patch) | |
tree | 98f3f9cd39d15c486ccfc31576be61d4d7b15630 | |
parent | 5a0a8dd223c21c1a54b681346696971fe22cd137 (diff) | |
download | pentadactyl-adc201f4454aabb9fbca693094394af114b639bc.tar.gz |
Fix bookmarks.isBookmark yet again. Check manually, this time.
-rw-r--r-- | common/content/bookmarks.js | 9 | ||||
-rw-r--r-- | common/content/tabs.js | 2 | ||||
-rwxr-xr-x | common/modules/storage.jsm | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index b092b577..865da474 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -124,7 +124,7 @@ function Bookmarks() //{{{ return bookmarks.length < length; } - function findRoot(id) + this.findRoot = function findRoot(id) { do { @@ -134,6 +134,8 @@ function Bookmarks() //{{{ return root; } + this.isBookmark = function (id) rootFolders.indexOf(self.findRoot(id)) >= 0; + // since we don't use a threaded bookmark loading (by set preload) // anymore, is this loading synchronization still needed? --mst let loading = false; @@ -189,7 +191,7 @@ function Bookmarks() //{{{ // liberator.dump("onItemAdded(" + itemId + ", " + folder + ", " + index + ")\n"); if (bookmarksService.getItemType(itemId) == bookmarksService.TYPE_BOOKMARK) { - if (rootFolders.indexOf(findRoot(itemId)) >= 0) + if (self.isBookmark(itemId)) { let bmark = loadBookmark(readBookmark(itemId)); storage.fireEvent(name, "add", bmark); @@ -606,7 +608,8 @@ function Bookmarks() //{{{ { try { - return bookmarksService.isBookmarked(util.newURI(url)); + return bookmarksService.getBookmarkIdsForURI(makeURI(url), {}) + .some(cache.isBookmark); } catch (e) { diff --git a/common/content/tabs.js b/common/content/tabs.js index 07349e8d..fec81609 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -173,7 +173,7 @@ function Tabs() //{{{ setter: function (value) { let [open, restriction] = [1, 0]; - for (let [, opt] in Iterator(this.parseValue(value))) + for (let [, opt] in Iterator(this.parseValues(value))) { if (opt == "tab") open = 3; diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm index 337c7eb7..f5489735 100755 --- a/common/modules/storage.jsm +++ b/common/modules/storage.jsm @@ -305,7 +305,7 @@ var observers = {}; var timers = {}; var storage = { - alwaysReload: [], + alwaysReload: {}, newObject: function newObject(key, constructor, store, type, options, reload) { if (!(key in keys) || reload || key in this.alwaysReload) |