Ticket #185 (closed defect: fixed)

Opened 4 weeks ago

Last modified 4 weeks ago

Sparkle doesn't update NSUserDefaultsController when setting the auto-update pref

Reported by: boredzo Assigned to:
Priority: minor Milestone:
Component: Framework Version:
Keywords: trunk preference NSUserDefaultsController Bindings patch Cc:

Description

On the host app's second launch, Sparkle asks the user whether to automatically check for updates, then sets the value for the preference key SUEnableAutomaticChecksKey to the user's answer.

But Sparkle only uses its own SUUserDefaults object to set the preference; thus, any UI controls that are bound to the preference through NSUserDefaultsController don't hear about the change.

The fix is to set the preference through NSUDC. I'm attaching a patch to trunk@r150 to do this.

I've left in the existing SUUserDefaults-based statement in case you need that for something. However, I don't know whether you do; you may want to remove it before committing the patch.

Attachments

Sparkle-trunk-r150-NSUDC.diff (0.7 kB) - added by boredzo on 04/19/08 22:21:33.
Patch adding a statement to set SUEnableAutomaticChecksKey through NSUserDefaultsController as well as through SUUserDefaults.

Change History

04/19/08 22:21:33 changed by boredzo

  • attachment Sparkle-trunk-r150-NSUDC.diff added.

Patch adding a statement to set SUEnableAutomaticChecksKey through NSUserDefaultsController as well as through SUUserDefaults.

04/21/08 11:38:29 changed by andym

  • status changed from new to closed.
  • resolution set to fixed.

Fixed by revision [151]. This turns out not to fix things in all cases: the reason I use SUUserDefaults is to support updating the user defaults of non-app bundles. Obviously, the fix won't work for them. But a -synchronize call to the shared user defaults will fix this for .apps.

Thanks for reporting this, boredzo.