# HG changeset patch # User Frank-Rainer Grahl # Date 1730592956 -3600 # Parent b6473b4201687fc097f215ea89ec948b47ee6e58 Bug 1932731 - Part 1 Use Services.xulstore in places treeview. r=IanN a=IanN - Bug 1476030 added the xulstore to Services. diff --git a/suite/components/places/content/treeView.js b/suite/components/places/content/treeView.js --- a/suite/components/places/content/treeView.js +++ b/suite/components/places/content/treeView.js @@ -47,24 +47,16 @@ function PlacesTreeView(aFlatList, aOnOp this._controller = aController; } PlacesTreeView.prototype = { get wrappedJSObject() { return this; }, - __xulStore: null, - get _xulStore() { - if (!this.__xulStore) { - this.__xulStore = Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore); - } - return this.__xulStore; - }, - QueryInterface: XPCOMUtils.generateQI(PTV_interfaces), // Bug 761494: // ---------- // Some addons use methods from nsINavHistoryResultObserver and // nsINavHistoryResultTreeViewer, without QIing to these interfaces first. // That's not a problem when the view is retrieved through the // .view getter (which returns the wrappedJSObject of this object), @@ -359,17 +351,17 @@ PlacesTreeView.prototype = { // Recursively do containers. if (!this._flatList && curChild instanceof Ci.nsINavHistoryContainerResultNode && !this._controller.hasCachedLivemarkInfo(curChild)) { let uri = curChild.uri; let isopen = false; if (uri) { - let val = this._xulStore.getValue(document.documentURI, uri, "open"); + let val = Services.xulStore.getValue(document.documentURI, uri, "open"); isopen = (val == "true"); } if (isopen != curChild.containerOpen) aToOpen.push(curChild); else if (curChild.containerOpen && curChild.childCount > 0) rowsInserted += this._buildVisibleSection(curChild, row + 1, aToOpen); } @@ -1599,19 +1591,19 @@ PlacesTreeView.prototype = { // Persist containers open status, but never persist livemarks. if (!this._controller.hasCachedLivemarkInfo(node)) { let uri = node.uri; if (uri) { let docURI = document.documentURI; if (node.containerOpen) { - this._xulStore.removeValue(docURI, uri, "open"); + Services.xulStore.removeValue(docURI, uri, "open"); } else { - this._xulStore.setValue(docURI, uri, "open", "true"); + Services.xulStore.setValue(docURI, uri, "open", "true"); } } } node.containerOpen = !node.containerOpen; }, cycleHeader: function PTV_cycleHeader(aColumn) {