Closed Bug 1530532 Opened 5 years ago Closed 5 years ago

Stop using Preferences.jsm

Categories

(Thunderbird :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 67.0

People

(Reporter: darktrojan, Assigned: darktrojan)

References

Details

Attachments

(1 file)

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.

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.

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.

Attachment #9046566 - Flags: review?(philipp)
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?
Attachment #9046566 - Flags: review?(philipp) → review+

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.

Just checking you're happy before I land this.

Flags: needinfo?(philipp)

🎶 I'm happy 🎶
Thanks :)

Flags: needinfo?(philipp)

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/6329bd856957
Minimise uses of Preferences.jsm; r=Fallen DONTBUILD

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 67.0
Depends on: 1533821
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: