Closed Bug 569274 Opened 13 years ago Closed 13 years ago

Remove use of deprecated nsIPref

Categories

(Camino Graveyard :: General, defect)

All
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stuart.morgan+bugzilla, Assigned: stuart.morgan+bugzilla)

References

Details

Attachments

(1 file)

We have some scattered use of the long-deprecated nsIPref, which is removed in 1.9.3. We may as well stop using it now so we're closer to 1.9.3-buildability.
Attached patch No more nsIPrefSplinter Review
This was really easy, since we already had a replacement for the observers, and for the easy stuff nsIPrefBranch is a drop-in replacment.
Attachment #448434 - Flags: superreview?(mikepinkerton)
Comment on attachment 448434 [details] [diff] [review]
No more nsIPref

Drive-by:

>diff --git a/src/formfill/KeychainService.mm b/src/formfill/KeychainService.mm

>-    // register for the cocoa notification posted when XPCOM shutdown so we
>-    // can unregister the pref callbacks we register below
>-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(shutdown:) name:XPCOMShutDownNotificationName
>-      object:nil];
>+    // Register for the cocoa notification posted when XPCOM shutdown so we
>+    // can dealloced the shared instance.

As long as you're changing this comment, can you make it make sense?  The "when XPCOM shutdown" phrase is missing a verb or something, and even if "dealloced" is a verb, it's the wrong tense for this usage. I think it should be

>+    // Register for the Cocoa notification posted when XPCOM shuts down so we
>+    // can dealloc the shared instance.

(or maybe "when XPCOM shutdown occurs" and "deallocate"? Not sure which ones convey the right info).  (There's a similar comment in shutdown: [~ line 203] which is more clear as a comment, but I'm not sure how the two are related content-wise, so it's not helping me much in guessing what the right forms should be here.)
Comment on attachment 448434 [details] [diff] [review]
No more nsIPref

+  if (NS_FAILED(mPrefs->PrefHasUserValue(kGeckoPrefHomepageURL, &homepagePrefExists)) ||
+      !homepagePrefExists)
+  {

brace on the same line?

sr=pink
Attachment #448434 - Flags: superreview?(mikepinkerton) → superreview+
Landed 3107:30ce0bcaf025 and on CVS trunk with comment fixed.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.