Stop using Preferences.jsm
Categories
(Thunderbird :: General, enhancement)
Tracking
(Not tracked)
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
Attachments
(1 file)
241.40 KB,
patch
|
Fallen
:
review+
|
Details | Diff | Splinter Review |
We use Preferences.jsm in lots of places (mostly calendar) to provide a default value to getBoolPref/getIntPref/getCharPref. We don't need to do that now since bug 1338306 landed in mozilla54. I think we should remove the uses now, before the Firefox team decide to rip it out from under us.
Assignee | ||
Comment 1•5 years ago
|
||
And also because of the presence of preferenceBindings.jsm, which also has an object called Preferences that does something similar but different. Let's not confuse ourselves with that one, again.
Assignee | ||
Comment 2•5 years ago
|
||
I did most of this with regular expression replacement. There are still a few cases left where the type of pref is variable. I decided it's not worth duplicating the code to handle that at this point.
Comment 3•5 years ago
|
||
Comment on attachment 9046566 [details] [diff] [review] 1530532-use-services-prefs-1.diff Review of attachment 9046566 [details] [diff] [review]: ----------------------------------------------------------------- I gave this a quick gloss over and it looks ok. I didn't see specific cases of how you handled prefs with variable types. Can you point me to one or let me know how you solved deciding what get*Pref function you used?
Assignee | ||
Comment 4•5 years ago
|
||
I've left behind the calls in these two functions and this one because the type of preference is unknown. Also this one for the reason given in the comment above it.
Generally I've just gone with what type the second argument is. If it's boolean, get/setBoolPref, integer etc.. Most of that was done with regexp. The rest I've figured out by looking at the code or just looking up the pref in about:config.
Assignee | ||
Comment 5•5 years ago
|
||
Just checking you're happy before I land this.
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/6329bd856957
Minimise uses of Preferences.jsm; r=Fallen DONTBUILD
Assignee | ||
Updated•5 years ago
|
Description
•