Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Fix #7442: make API consistent between PrefMan and Prefixed PrefMan.#7564

Merged
redmunds merged 1 commit intomasterfrom
dangoor/7442-pref-consistency
Apr 18, 2014
Merged

Fix #7442: make API consistent between PrefMan and Prefixed PrefMan.#7564
redmunds merged 1 commit intomasterfrom
dangoor/7442-pref-consistency

Conversation

@dangoor
Copy link
Copy Markdown
Contributor

@dangoor dangoor commented Apr 18, 2014

Fix for #7442

The slightly higher level API provided by PreferencesManager (over the
PreferencesBase.PreferencesSystem) worked nicely but was inconsistent
with the API an extension author gets when they call
PreferencesManager.getExtensionPrefs. This change pushes that extra
behavior down into PreferencesBase.PreferencesSystem so that the
APIs are consistent.

This is a non-breaking change that basically adds to the API:

  • doNotSave flag for set: calls to set() save automatically unless this flag is set. If extension code is already calling save(), that means that there will be an extra call to save(), but that should have minimal performance impact because save() does no saving when the scopes aren't dirty
  • support for string contexts: extensions would have to use complete object contexts previously. This adds support for the simpler string contexts and doesn't change the behavior for object contexts.

The slightly higher level API provided by PreferencesManager (over the
PreferencesBase.PreferencesSystem) worked nicely but was inconsistent
with the API an extension author gets when they call
`PreferencesManager.getExtensionPrefs`. This change pushes that extra
behavior down into PreferencesBase.PreferencesSystem so that the
APIs are consistent.

This is a non-breaking change that basically adds to the API:

* doNotSave flag for set: calls to `set()` save automatically unless this flag is set. If extension code is already calling `save()`, that means that there will be an extra call to `save()`, but that should have minimal performance impact because `save()` does no saving when the scopes aren't dirty
* support for string contexts: extensions would have to use complete object contexts previously. This adds support for the simpler string contexts and doesn't change the behavior for object contexts.
@dangoor
Copy link
Copy Markdown
Contributor Author

dangoor commented Apr 18, 2014

@jasonsanjose this will fix up the pain you had with preferences in your extension recently.

@jasonsanjose
Copy link
Copy Markdown
Member

Great, thanks!

@redmunds redmunds self-assigned this Apr 18, 2014
@redmunds
Copy link
Copy Markdown
Contributor

Looks good. Merging.

redmunds added a commit that referenced this pull request Apr 18, 2014
Fix #7442: make API consistent between PrefMan and Prefixed PrefMan.
@redmunds redmunds merged commit f74acd4 into master Apr 18, 2014
@redmunds redmunds deleted the dangoor/7442-pref-consistency branch April 18, 2014 21:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants