Closed
Bug 754573
Opened 13 years ago
Closed 13 years ago
remove Services.prefs.getBranch(null) occurrence in Toolkit browser.xml
Categories
(Toolkit :: General, defect)
Toolkit
General
Tracking
()
VERIFIED
FIXED
mozilla15
People
(Reporter: aceman, Assigned: aceman)
References
()
Details
Attachments
(1 file, 2 obsolete files)
13.87 KB,
patch
|
aceman
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #738568 comment 48 to comment 53 +++
459 <field name="mPrefs" readonly="true">
460 Components.classes['@mozilla.org/preferences-service;1']
461 .getService(Components.interfaces.nsIPrefService)
462 .getBranch(null);
463 </field>
Then just get rid of the ".getBranch(null)" part.
***
254 <property name="preferences"
255 onget="return Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService);"
256 readonly="true"/>
I'm not sure why there are 2 nsIPrefService services in this file.
Maybe one could be removed or at least use the other one?
Philip Chee 2012-03-31 12:09:37 CEST
Both came from Hewitt's initial checkin for Bug 165955 - Check in Satchel (the successor to wallet). It's probably an accidental (manual) merge between Phoenix and the XPFE browser bindings. According to MXR the preferences property isn't used anywhere.
:Gavin Sharp (use gavin@gavinsharp.com for email) 2012-04-03 00:19:34 CEST
(In reply to Serge Gautherie (:sgautherie) from comment #51)
> 459 <field name="mPrefs" readonly="true">
> 460 Components.classes['@mozilla.org/preferences-service;1']
> 461 .getService(Components.interfaces.nsIPrefService)
> 462 .getBranch(null);
>
> Then just get rid of the ".getBranch(null)" part.
You also need to change the nsIPrefService to nsIPrefBranch.
Does what the comments recommend.
While there, I removed some trailing whitespace.
Attachment #623422 -
Flags: review?(gavin.sharp)
Comment 2•13 years ago
|
||
Comment on attachment 623422 [details] [diff] [review]
patch
>diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml
>- <property name="preferences"
Removing this will likely break someone - just make it call the other property and keep it for compatibility.
>- promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
>+ promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
If you're going to touch this you might as well add the missing "var" :)
Attachment #623422 -
Flags: review?(gavin.sharp) → review-
Thanks.
Attachment #623422 -
Attachment is obsolete: true
Attachment #624136 -
Flags: review?(gavin.sharp)
Comment 4•13 years ago
|
||
Comment on attachment 624136 [details] [diff] [review]
patch v2
>diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml
> <property name="preferences"
>- onget="return Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService);"
>+ onget="return this.mPrefs;"
mPrefs is an nsIPrefBranch, so to maintain compat you'll need this.mPrefs.QueryInterface(Components.interfaces.nsIPrefService).
r=me with that.
Attachment #624136 -
Flags: review?(gavin.sharp) → review+
OK, done.
Attachment #624136 -
Attachment is obsolete: true
Attachment #624182 -
Flags: review+
Keywords: checkin-needed
Comment 6•13 years ago
|
||
Comment 7•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 8•13 years ago
|
||
V.Fixed, per MXR search.
You need to log in
before you can comment on or make changes to this bug.
Description
•