Closed Bug 346599 Opened 18 years ago Closed 18 years ago

customizeCharset.js uses deprecated nsIPref

Categories

(Toolkit :: Preferences, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: joelnackman, Assigned: joelnackman)

References

()

Details

Attachments

(1 file, 2 obsolete files)

customizeCharset.js uses nsIPref on line 15 instead of nsIPrefService/nsIPrefBranch. nsIPref is deprecated.
Attached patch Patch (obsolete) — Splinter Review
I believe that this patch will fix the problem, but I was not sure about one of the changes that I made. On line 27, getLocalizedUnicharPref is called. I replaced this with getComplexValue from nsIPrefBranch, because I found that this is what is called anyway here: http://lxr.mozilla.org/seamonkey/source/toolkit/obsolete/content/nsUserSettings.js#90 Is this the correct approach to handling the Unichar value, and is there any documentation that somebody could point me to that would help me understand the differences?
OS: Mac OS X 10.3 → All
Hardware: Macintosh → All
Version: unspecified → Trunk
Thanks for the patch, but you also need to request a review from a toolkit reviewer in order to get it in. The approach you took looks fine. about 'localized prefs' see: http://kb.mozillazine.org/Dev_:_Using_preferences#nsIPrefLocalizedString
Assignee: nobody → joelnackman
Attachment #231352 - Flags: first-review?(neil)
Comment on attachment 231352 [details] [diff] [review] Patch I don't think you should use setCharPref. I patched the xpfe version of this file in bug 230778 but if you clone my code you can't then ask me for review ;-)
Attachment #231352 - Flags: first-review?(neil) → first-review-
Attached patch Patch w/o setCharPref (obsolete) — Splinter Review
Attachment #231352 - Attachment is obsolete: true
Attachment #242444 - Flags: first-review?(enndeakin)
I don't think that works, did you actually test it? You want to create an nsIPrefLocalizedString object, set its value, and pass it to setComplexPref, like here: http://kb.mozillazine.org/Dev_:_Using_preferences#nsIPrefLocalizedString Or just do what Neil did for the suite.
Attached patch Fixed patchSplinter Review
Whoops. I tested the wrong thing, which is why it appeared to work to me. I think I've straigtened it out now (hopefully).
Attachment #242444 - Attachment is obsolete: true
Attachment #242444 - Flags: first-review?(enndeakin)
Attachment #242573 - Flags: first-review?(enndeakin)
Comment on attachment 242573 [details] [diff] [review] Fixed patch I'm not actually the same Neil. I could review this, but it seems more logical to have him do it if he wrote the original xpfe code.
Attachment #242573 - Flags: first-review?(enndeakin) → first-review?(neil)
Comment on attachment 242573 [details] [diff] [review] Fixed patch OK, I'll review it anyway ;) I misread "can't" above as "can".
Attachment #242573 - Flags: first-review?(neil) → first-review+
To get a patch checked in you normally need to put "[checkin needed]" into status whiteboard and/or ask someone to check it in for you if you want to wait less than a few weeks :)
Whiteboard: [checkin needed]
mozilla/toolkit/content/customizeCharset.js 1.3
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: