This may seem rather irrelevant, but I would prefer to see Chimera use NSUserDefaults instead of the traditional .mozilla files. This would reduce the amount of legacy code needed to interface to the more archaic and less Mac-like Mozilla system. NSUserDefaults are described in detail in the Cocoa documentation, and are very easy to use. This change would also prevent conflicts between Mozilla and Chimera preferences, as well as fixing any locked-file errors, since the OS manages the NSUserDefaults files itself. The only disadvantage is that bookmarks would not be automatically shared between Mozilla and Chimera, but this could easily be corrected by adding an "Import Mozilla Bookmarks" command.
Another thought, this might enable a dylib or two to be removed from the build. Also an advantage.
yup, we could replace the pref service with this, just make an API wrapper for the NSUserDefaults API. Not likely to get done soon unless you or someone else would like to contribute the code, it shouldn't be that hard, mostly build system configurability to choose which pref service to build and use.
Status: NEW → ASSIGNED
Priority: -- → P5
Summary: Use NSUserDefaults instead of .mozilla files → [RFE] Use NSUserDefaults instead of .mozilla files
smfr and i have talked a bit about this. having the prefs in two different places is suboptimal, but we're not sure if the NSUserDefaults can do things like pref-changed callbacks which would be required to reimpl gecko's pref service with NSUserDefaults. Certainly an avenue worth exploring.
Yeah, we talked about it as well. Another problem with using this as the backend for our prefs is that there is one data set per OS user account. If we ever wanted to have multiple profiles per OS account (like mozilla and most embedding apps) that would not work.
over to simon (with his permission).
Assignee: saari → sfraser
Status: ASSIGNED → NEW
Instead of NSUserDefaults you could use the lower level Core Foundation Preferences. CF Preferences supports saving preferences per application, per user, and per host. So a user can have different preferences for different machines. That might provide the flexibility you are looking for. CF Preferences also supports Unicode. That could be useful for non-English speaking users. BTW: NSUserDefaults supports command line arguments and environment settings. Those values are treated the same as defaults stored in the plist file.
> CF Preferences supports saving preferences per application, per user, and per host. So a user can have different preferences for different machines. Ooh - that is appealing. Brian, imagine if the prefs impl had pluggable backend data storage! And if, on OS X, it was CF Preferences what sort of startup time reduction we could get. Also, CF Preferences would not be limited to Cocoa apps so mozilla and embedding apps could benefit.
An interesting thought, though there would be some issues to sort out regarding the items in /defaults/pref (which is really where we are taking the startup time hit anyway.) We would either be looking at some kind of a dual read mechanism (one for defaults and one for "prefs.js") or having to pre-populate the CF Preferences database with the default values. The third option would be to store the defaults in a platform specific manner, but that would likely end up being a nightmare because any new pref would have to be added to every platform... I don't think we want to go there...
Severity: trivial → enhancement
Priority: P5 → P4
Summary: [RFE] Use NSUserDefaults instead of .mozilla files → Use NSUserDefaults instead of .mozilla files
i think we should wontfix this.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.